当前位置: 首页>>代码示例>>Java>>正文


Java StorageManagerFactory类代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:23,代码来源:StoreTableExec.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:24,代码来源:SortBasedColPartitionStoreExec.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:27,代码来源:QueryMaster.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:30,代码来源:HashBasedColPartitionStoreExec.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:30,代码来源:TestExecutionBlockCursor.java

示例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);
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:35,代码来源:TestExecutionBlockCursor.java

示例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.");
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:45,代码来源:TajoMaster.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:5,代码来源:TajoQueryEngine.java

示例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.");
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:47,代码来源:TajoMaster.java


注:本文中的org.apache.tajo.storage.StorageManagerFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。