@Test(timeout = 120000) public void testGetFileTablespace() throws Exception { final Configuration hdfsConf = getTestHdfsConfiguration(); final MiniDFSCluster cluster = new MiniDFSCluster.Builder(hdfsConf) .numDataNodes(1).format(true).build(); URI uri = URI.create(cluster.getFileSystem().getUri() + "/tajo"); try { FileTablespace space = TablespaceManager.getLocalFs(); assertEquals(localFs.getUri(), space.getFileSystem().getUri()); FileTablespace distTablespace = new FileTablespace("testGetFileTablespace", uri, null); distTablespace.init(conf); TablespaceManager.addTableSpaceForTest(distTablespace); space = TablespaceManager.get(uri); assertEquals(cluster.getFileSystem().getUri(), space.getFileSystem().getUri()); space = TablespaceManager.getByName("testGetFileTablespace"); assertEquals(cluster.getFileSystem().getUri(), space.getFileSystem().getUri()); } finally { cluster.shutdown(); } }
public FileSystem getFileSystem() { return this.fs; }
FileTablespace extends Tablespace { public FileSystem getFileSystem() { return this.fs; } }
FileTablespace extends Tablespace { public FileSystem getFileSystem() { return this.fs; } FileTablespace(String spaceName, URI uri, JSONObject config); }
FileTablespace extends Tablespace { public FileSystem getFileSystem() { return this.fs; } FileTablespace(String spaceName, URI uri, JSONObject config); @Override long getTableVolume(TableDesc table, Optional<EvalNode> filter); @Override URI getRootUri(); Scanner getFileScanner(TableMeta meta, Schema schema, Path path); Scanner getFileScanner(TableMeta meta, Schema schema, Path path, FileStatus status); FileSystem getFileSystem(); void delete(Path tablePath); boolean exists(Path path); @Override URI getTableUri(TableMeta meta, String databaseName, String tableName); @VisibleForTesting Appender getAppender(TableMeta meta, Schema schema, Path filePath); FileFragment[] split(String tableName, Path tablePath); static FileFragment[] splitNG(Configuration conf, String tableName, TableMeta meta,
                                       Path tablePath, long size); long calculateSize(Path tablePath); Path getAppenderFilePath(TaskAttemptId taskAttemptId, Path workDir); long getMinSplitSize(); List<Fragment> getSplits(String tableName, TableMeta meta, Schema schema, boolean requireSort, Path... inputs); @Override List<Fragment> getSplits(String inputSourceId,
                                  TableDesc table,
                                  boolean requireSort,
                                  @Nullable EvalNode filterCondition); @Override void createTable(TableDesc tableDesc, boolean ifNotExists); @Override void purgeTable(TableDesc tableDesc); @Override StorageProperty getProperty(); @Override FormatProperty getFormatProperty(TableMeta meta); @Override void close(); @Override void prepareTable(LogicalNode node); @Override void rollbackTable(LogicalNode node); @Override URI getStagingUri(OverridableConf context, String queryId, TableMeta meta); URI prepareStagingSpace(TajoConf conf, String queryId, OverridableConf context, TableMeta meta); @Override void verifySchemaToWrite(TableDesc tableDesc, Schema outSchema); @Override Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId, LogicalPlan plan,
                          Schema schema, TableDesc tableDesc); @Override TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc,
                                          Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange); }
FileTablespace extends Tablespace { public FileSystem getFileSystem() { return this.fs; } FileTablespace(String spaceName, URI uri, JSONObject config); @Override long getTableVolume(TableDesc table, Optional<EvalNode> filter); @Override URI getRootUri(); Scanner getFileScanner(TableMeta meta, Schema schema, Path path); Scanner getFileScanner(TableMeta meta, Schema schema, Path path, FileStatus status); FileSystem getFileSystem(); void delete(Path tablePath); boolean exists(Path path); @Override URI getTableUri(TableMeta meta, String databaseName, String tableName); @VisibleForTesting Appender getAppender(TableMeta meta, Schema schema, Path filePath); FileFragment[] split(String tableName, Path tablePath); static FileFragment[] splitNG(Configuration conf, String tableName, TableMeta meta,
                                       Path tablePath, long size); long calculateSize(Path tablePath); Path getAppenderFilePath(TaskAttemptId taskAttemptId, Path workDir); long getMinSplitSize(); List<Fragment> getSplits(String tableName, TableMeta meta, Schema schema, boolean requireSort, Path... inputs); @Override List<Fragment> getSplits(String inputSourceId,
                                  TableDesc table,
                                  boolean requireSort,
                                  @Nullable EvalNode filterCondition); @Override void createTable(TableDesc tableDesc, boolean ifNotExists); @Override void purgeTable(TableDesc tableDesc); @Override StorageProperty getProperty(); @Override FormatProperty getFormatProperty(TableMeta meta); @Override void close(); @Override void prepareTable(LogicalNode node); @Override void rollbackTable(LogicalNode node); @Override URI getStagingUri(OverridableConf context, String queryId, TableMeta meta); URI prepareStagingSpace(TajoConf conf, String queryId, OverridableConf context, TableMeta meta); @Override void verifySchemaToWrite(TableDesc tableDesc, Schema outSchema); @Override Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId, LogicalPlan plan,
                          Schema schema, TableDesc tableDesc); @Override TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc,
                                          Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange); static final PathFilter hiddenFileFilter; final static FsPermission STAGING_DIR_PERMISSION; static final String TMP_STAGING_DIR_PREFIX; }