Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/602#discussion_r32801511
  
    --- Diff: 
tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/Tablespace.java
 ---
    @@ -69,24 +77,47 @@ public Tablespace(String storeType) {
        */
       protected abstract void storageInit() throws IOException;
     
    +  public String getName() {
    +    return name;
    +  }
    +
    +  public URI getUri() {
    +    return uri;
    +  }
    +
    +  public boolean isVisible() {
    +    return visible;
    +  }
    +
    +  public abstract void setConfig(String name, String value);
    +
    +  public abstract void setConfigs(Map<String, String> configs);
    +
    +  public String toString() {
    +    return name + "=" + uri.toString();
    +  }
    +
    +  public abstract long getTableVolume(URI uri) throws IOException;
    +
       /**
    -   * This method is called after executing "CREATE TABLE" statement.
    -   * If a storage is a file based storage, a storage manager may create 
directory.
    +   * if {@link StorageProperty#isArbitraryPathAllowed} is true,
    +   * the storage allows arbitrary path accesses. In this case, the storage 
must provide the root URI.
        *
    -   * @param tableDesc Table description which is created.
    -   * @param ifNotExists Creates the table only when the table does not 
exist.
    -   * @throws java.io.IOException
    +   * @see {@link StorageProperty#isArbitraryPathAllowed}
    +   * @return Root URI
        */
    -  public abstract void createTable(TableDesc tableDesc, boolean 
ifNotExists) throws IOException;
    +  public URI getRootUri() {
    +    throw new UnsupportedException(
    +        String.format("Tablespace '%s' does not allow the use of artibrary 
paths", uri.toString()));
    +  }
     
       /**
    -   * This method is called after executing "DROP TABLE" statement with the 
'PURGE' option
    -   * which is the option to delete all the data.
    +   * Get Table URI
        *
    -   * @param tableDesc
    -   * @throws java.io.IOException
    +   * @param tableName
    +   * @return
        */
    -  public abstract void purgeTable(TableDesc tableDesc) throws IOException;
    +  public abstract URI getTableUri(String databaseName, String tableName);
    --- End diff --
    
    Later, TablespaceManager will have additional APIs to wrap Tablespace APIs. 
This is because getting a tablespace and calling an API of tablespace are a 
frequently-used call routine. I'll add more utility static methods like them to 
TablespaceManager.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to