public void shutdown() { this.catalog.stop(); }
public LocalCatalogWrapper(final CatalogServer server) { this(server, server.getConf()); }
public LocalCatalogWrapper(final CatalogServer server, final TajoConf conf) { super(conf); this.catalog = server; this.stub = server.getHandler(); }
public CatalogServer startCatalogCluster() throws Exception { if(isCatalogServerRunning) throw new IOException("Catalog Cluster already running"); CatalogTestingUtil.configureCatalog(conf, clusterTestBuildDir.getAbsolutePath()); LOG.info("Apache Derby repository is set to " + conf.get(CatalogConstants.CATALOG_URI)); conf.setVar(ConfVars.CATALOG_ADDRESS, "localhost:0"); catalogServer = new CatalogServer(); catalogServer.init(conf); catalogServer.start(); isCatalogServerRunning = true; return this.catalogServer; }
@Override public void run() { if(!isInState(STATE.STOPPED)) { LOG.info("============================================"); LOG.info("TajoMaster received SIGINT Signal"); LOG.info("============================================"); stop(); // If embedded derby is used as catalog, shutdown it. if (catalogServer != null && catalogServer.getStoreClassName().equals("org.apache.tajo.catalog.store.DerbyStore") && AbstractDBStore.needShutdown(catalogServer.getStoreUri())) { DerbyStore.shutdown(); } RpcClientManager.shutdown(); } } }
diagnoseTajoMaster(); catalogServer = new CatalogServer(TablespaceManager.getMetadataProviders(), loadFunctions()); addIfService(catalogServer); catalog = new LocalCatalogWrapper(catalogServer, systemConf);
LOG.info("===================================================================================="); LOG.info("= * Master Address: " + tajoMaster.getMasterName()); LOG.info("= * CatalogStore: " + tajoMaster.getCatalogServer().getStoreClassName()); LOG.info("------------------------------------------------------------------------------------"); LOG.info("= * Warehouse Dir: " + TajoConf.getWarehouseDir(c));
/** * This is only for unit tests. */ @VisibleForTesting public void refresh() { catalogServer.refresh(TablespaceManager.getMetadataProviders()); }
@Override public void serviceInit(Configuration conf) throws Exception { Constructor<?> cons; try { if (conf instanceof TajoConf) { this.conf = (TajoConf) conf; } else { throw new TajoInternalError("conf must be a TajoConf instance"); } Class<?> storeClass = this.conf.getClass(CatalogConstants.STORE_CLASS, DerbyStore.class); LOG.info("Catalog Store Class: " + storeClass.getCanonicalName()); cons = storeClass. getConstructor(new Class [] {Configuration.class}); this.store = (CatalogStore) cons.newInstance(this.conf); initBuiltinFunctions(builtingFuncs); } catch (Throwable t) { LOG.error("CatalogServer initialization failed", t); throw new TajoInternalError(t); } super.serviceInit(conf); }
@Override public void serviceStart() throws Exception { LOG.info("TajoMaster is starting up"); startJvmPauseMonitor(); // check base tablespace and databases checkBaseTBSpaceAndDatabase(); super.serviceStart(); initSystemMetrics(); // Setting the system global configs systemConf.setVar(ConfVars.CATALOG_ADDRESS, NetUtils.getHostPortString(catalogServer.getBindAddress())); try { writeSystemConf(); } catch (IOException e) { LOG.error(e.getMessage(), e); } initWebServer(); haService = ServiceTrackerFactory.get(systemConf); haService.register(); historyWriter = new HistoryWriter(getMasterName(), true); historyWriter.init(getConfig()); addIfService(historyWriter); historyWriter.start(); historyReader = new HistoryReader(getMasterName(), context.getConf()); }
@Override public void run() { if(!isInState(STATE.STOPPED)) { LOG.info("============================================"); LOG.info("TajoMaster received SIGINT Signal"); LOG.info("============================================"); stop(); // If embedded derby is used as catalog, shutdown it. if (catalogServer != null && catalogServer.getStoreClassName().equals("org.apache.tajo.catalog.store.DerbyStore") && AbstractDBStore.needShutdown(catalogServer.getStoreUri())) { DerbyStore.shutdown(); } RpcClientManager.shutdown(); } } }
diagnoseTajoMaster(); catalogServer = new CatalogServer(TablespaceManager.getMetadataProviders(), loadFunctions()); addIfService(catalogServer); catalog = new LocalCatalogWrapper(catalogServer, systemConf);
/** * This is only for unit tests. */ @VisibleForTesting public void refresh() { catalogServer.refresh(TablespaceManager.getMetadataProviders()); }
@Override public void serviceInit(Configuration conf) throws Exception { Constructor<?> cons; try { if (conf instanceof TajoConf) { this.conf = (TajoConf) conf; } else { throw new TajoInternalError("conf must be a TajoConf instance"); } Class<?> storeClass = this.conf.getClass(CatalogConstants.STORE_CLASS, DerbyStore.class); LOG.info("Catalog Store Class: " + storeClass.getCanonicalName()); cons = storeClass. getConstructor(new Class [] {Configuration.class}); this.store = (CatalogStore) cons.newInstance(this.conf); initBuiltinFunctions(builtinFuncs); } catch (Throwable t) { LOG.error("CatalogServer initialization failed", t); throw new TajoInternalError(t); } super.serviceInit(conf); }
@Override public void serviceStart() throws Exception { LOG.info("TajoMaster is starting up"); startJvmPauseMonitor(); // check base tablespace and databases checkBaseTBSpaceAndDatabase(); super.serviceStart(); initSystemMetrics(); // Setting the system global configs systemConf.setSocketAddr(ConfVars.CATALOG_ADDRESS.varname, NetUtils.getConnectAddress(catalogServer.getBindAddress())); try { writeSystemConf(); } catch (IOException e) { LOG.error(e.getMessage(), e); } initWebServer(); haService = ServiceTrackerFactory.get(systemConf); haService.register(); historyWriter = new HistoryWriter(getMasterName(), true); historyWriter.init(getConfig()); addIfService(historyWriter); historyWriter.start(); historyReader = new HistoryReader(getMasterName(), context.getConf()); }
public void shutdown() { this.catalog.stop(); }
public LocalCatalogWrapper(final CatalogServer server, final TajoConf conf) { super(conf); this.catalog = server; this.stub = server.getHandler(); }
public LocalCatalogWrapper(final CatalogServer server) { this(server, server.getConf()); }
public void shutdownCatalogCluster() { try { CatalogTestingUtil.shutdownCatalogStore(conf); } catch (Exception e) { //ignore } if (catalogServer != null) { this.catalogServer.stop(); } isCatalogServerRunning = false; }