本文整理汇总了Java中org.apache.tajo.storage.StorageManagerFactory类的典型用法代码示例。如果您正苦于以下问题:Java StorageManagerFactory类的具体用法?Java StorageManagerFactory怎么用?Java StorageManagerFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StorageManagerFactory类属于org.apache.tajo.storage包,在下文中一共展示了StorageManagerFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
public void init() throws IOException {
super.init();
TableMeta meta;
if (plan.hasOptions()) {
meta = CatalogUtil.newTableMeta(plan.getStorageType(), plan.getOptions());
} else {
meta = CatalogUtil.newTableMeta(plan.getStorageType());
}
if (plan instanceof InsertNode) {
InsertNode createTableNode = (InsertNode) plan;
appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta,
createTableNode.getTableSchema(), context.getOutputPath());
} else {
appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta, outSchema,
context.getOutputPath());
}
appender.enableStats();
appender.init();
}
示例2: getAppender
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
private Appender getAppender(String partition) throws IOException {
Path dataFile = getDataFile(partition);
FileSystem fs = dataFile.getFileSystem(context.getConf());
if (fs.exists(dataFile.getParent())) {
LOG.info("Path " + dataFile.getParent() + " already exists!");
} else {
fs.mkdirs(dataFile.getParent());
LOG.info("Add subpartition path directory :" + dataFile.getParent());
}
if (fs.exists(dataFile)) {
LOG.info("File " + dataFile + " already exists!");
FileStatus status = fs.getFileStatus(dataFile);
LOG.info("File size: " + status.getLen());
}
appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta, outSchema, dataFile);
appender.enableStats();
appender.init();
return appender;
}
示例3: init
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
public void init(Configuration conf) {
LOG.info("QueryMaster init");
try {
this.systemConf = (TajoConf)conf;
this.connPool = RpcConnectionPool.getPool(systemConf);
querySessionTimeout = systemConf.getIntVar(TajoConf.ConfVars.QUERY_SESSION_TIMEOUT);
queryMasterContext = new QueryMasterContext(systemConf);
clock = new SystemClock();
this.dispatcher = new TajoAsyncDispatcher("querymaster_" + System.currentTimeMillis());
addIfService(dispatcher);
this.storageManager = StorageManagerFactory.getStorageManager(systemConf);
globalPlanner = new GlobalPlanner(systemConf, workerContext);
dispatcher.register(QueryStartEvent.EventType.class, new QueryStartEventHandler());
} catch (Throwable t) {
LOG.error(t.getMessage(), t);
throw new RuntimeException(t);
}
super.init(conf);
}
示例4: getAppender
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
private Appender getAppender(String partition) throws IOException {
Appender appender = appenderMap.get(partition);
if (appender == null) {
Path dataFile = getDataFile(partition);
FileSystem fs = dataFile.getFileSystem(context.getConf());
if (fs.exists(dataFile.getParent())) {
LOG.info("Path " + dataFile.getParent() + " already exists!");
} else {
fs.mkdirs(dataFile.getParent());
LOG.info("Add subpartition path directory :" + dataFile.getParent());
}
if (fs.exists(dataFile)) {
LOG.info("File " + dataFile + " already exists!");
FileStatus status = fs.getFileStatus(dataFile);
LOG.info("File size: " + status.getLen());
}
appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta, outSchema, dataFile);
appender.enableStats();
appender.init();
appenderMap.put(partition, appender);
} else {
appender = appenderMap.get(partition);
}
return appender;
}
示例5: setUp
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws Exception {
util = new TajoTestingCluster();
util.startCatalogCluster();
conf = util.getConfiguration();
catalog = util.getMiniCatalogCluster().getCatalog();
TPCH tpch = new TPCH();
tpch.loadSchemas();
tpch.loadOutSchema();
for (String table : tpch.getTableNames()) {
TableMeta m = CatalogUtil.newTableMeta(CatalogProtos.StoreType.CSV);
TableDesc d = CatalogUtil.newTableDesc(table, tpch.getSchema(table), m, CommonTestingUtil.getTestDir());
TableStats stats = new TableStats();
stats.setNumBytes(TPCH.tableVolumes.get(table));
d.setStats(stats);
catalog.addTable(d);
}
analyzer = new SQLAnalyzer();
logicalPlanner = new LogicalPlanner(catalog);
optimizer = new LogicalOptimizer(conf);
AbstractStorageManager sm = StorageManagerFactory.getStorageManager(conf);
dispatcher = new AsyncDispatcher();
dispatcher.init(conf);
dispatcher.start();
planner = new GlobalPlanner(conf, catalog);
}
示例6: setUp
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws Exception {
util = new TajoTestingCluster();
util.startCatalogCluster();
conf = util.getConfiguration();
conf.set(TajoConf.ConfVars.DIST_QUERY_BROADCAST_JOIN_AUTO.varname, "false");
catalog = util.getMiniCatalogCluster().getCatalog();
catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:!234/warehouse");
catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
TPCH tpch = new TPCH();
tpch.loadSchemas();
tpch.loadOutSchema();
for (String table : tpch.getTableNames()) {
TableMeta m = CatalogUtil.newTableMeta(CatalogProtos.StoreType.CSV);
TableDesc d = CatalogUtil.newTableDesc(
CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, table), tpch.getSchema(table), m, CommonTestingUtil.getTestDir());
TableStats stats = new TableStats();
stats.setNumBytes(TPCH.tableVolumes.get(table));
d.setStats(stats);
catalog.createTable(d);
}
analyzer = new SQLAnalyzer();
logicalPlanner = new LogicalPlanner(catalog);
optimizer = new LogicalOptimizer(conf);
AbstractStorageManager sm = StorageManagerFactory.getStorageManager(conf);
dispatcher = new AsyncDispatcher();
dispatcher.init(conf);
dispatcher.start();
planner = new GlobalPlanner(conf, catalog);
}
示例7: init
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
@Override
public void init(Configuration _conf) {
this.systemConf = (TajoConf) _conf;
context = new MasterContext(systemConf);
clock = new SystemClock();
try {
RackResolver.init(systemConf);
initResourceManager();
initWebServer();
this.dispatcher = new AsyncDispatcher();
addIfService(dispatcher);
// check the system directory and create if they are not created.
checkAndInitializeSystemDirectories();
this.storeManager = StorageManagerFactory.getStorageManager(systemConf);
catalogServer = new CatalogServer(initBuiltinFunctions());
addIfService(catalogServer);
catalog = new LocalCatalogWrapper(catalogServer, systemConf);
globalEngine = new GlobalEngine(context);
addIfService(globalEngine);
queryJobManager = new QueryJobManager(context);
addIfService(queryJobManager);
tajoMasterClientService = new TajoMasterClientService(context);
addIfService(tajoMasterClientService);
tajoMasterService = new TajoMasterService(context);
addIfService(tajoMasterService);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
super.init(systemConf);
LOG.info("Tajo Master is initialized.");
}
示例8: TajoQueryEngine
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
public TajoQueryEngine(TajoConf conf) throws IOException {
this.storageManager = StorageManagerFactory.getStorageManager(conf);
this.phyPlanner = new PhysicalPlannerImpl(conf, storageManager);
}
示例9: init
import org.apache.tajo.storage.StorageManagerFactory; //导入依赖的package包/类
@Override
public void init(Configuration _conf) {
this.systemConf = (TajoConf) _conf;
context = new MasterContext(systemConf);
clock = new SystemClock();
try {
RackResolver.init(systemConf);
initResourceManager();
initWebServer();
this.dispatcher = new AsyncDispatcher();
addIfService(dispatcher);
// check the system directory and create if they are not created.
checkAndInitializeSystemDirectories();
this.storeManager = StorageManagerFactory.getStorageManager(systemConf);
catalogServer = new CatalogServer(initBuiltinFunctions());
addIfService(catalogServer);
catalog = new LocalCatalogWrapper(catalogServer);
sessionManager = new SessionManager(dispatcher);
addIfService(sessionManager);
globalEngine = new GlobalEngine(context);
addIfService(globalEngine);
queryJobManager = new QueryJobManager(context);
addIfService(queryJobManager);
tajoMasterClientService = new TajoMasterClientService(context);
addIfService(tajoMasterClientService);
tajoMasterService = new TajoMasterService(context);
addIfService(tajoMasterService);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw new RuntimeException(e);
}
super.init(systemConf);
LOG.info("Tajo Master is initialized.");
}