drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #1032: DRILL-5089: Dynamically load schema of storage plu...
Date Mon, 13 Nov 2017 22:34:30 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1032#discussion_r150683680
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
---
    @@ -105,12 +106,36 @@ public SchemaPlus createRootSchema(final String userName, final
SchemaConfigInfo
        * @return
        */
       public SchemaPlus createRootSchema(SchemaConfig schemaConfig) {
    +      final SchemaPlus rootSchema = DynamicSchema.createRootSchema(dContext.getStorage(),
schemaConfig);
    +      schemaTreesToClose.add(rootSchema);
    +      return rootSchema;
    +  }
    +
    +  /**
    +   * Return full root schema with schema owner as the given user.
    +   *
    +   * @param userName Name of the user who is accessing the storage sources.
    +   * @param provider {@link SchemaConfigInfoProvider} instance
    +   * @return Root of the schema tree.
    +   */
    +  public SchemaPlus createFullRootSchema(final String userName, final SchemaConfigInfoProvider
provider) {
    +    final String schemaUser = isImpersonationEnabled ? userName : ImpersonationUtil.getProcessUserName();
    --- End diff --
    
    Should this be factored out somewhere? Seems this magic stanza will be needed in many
places: better to have one copy than several. Maybe a method in `ImpersonationUtil`?


---

Mime
View raw message