@Override public void close() throws BackendException { manager.close(); } },manager.openDatabase(SYSTEM_PROPERTIES_STORE_NAME),config);
@Override public void close() throws BackendException { manager.close(); }
public void close() throws BackendException { for (int i = 0; i < CONCURRENCY; i++) { idAuthorities[i].close(); manager[i].close(); } }
@Override public void close() throws BackendException { backend.close(); MetricManager.INSTANCE.getCounter(GLOBAL_PREFIX, managerMetricsName, M_CLOSE_MANAGER, M_CALLS).inc(); }
@Override public void shutdown() throws Exception { super.shutdown(); storeManager.close(); }
private void closeLogs() { try { for (final LogManager lm : logManagers.values()) lm.close(); logManagers.clear(); if (logStoreManager!=null) { logStoreManager.close(); logStoreManager=null; } } catch (final BackendException e) { throw new JanusGraphException(e); } }
@After public void shutdown() throws Exception { cache.close(); storeManager.close(); }
public void close() throws BackendException { if (tx != null) tx.commit(); if (null != store) store.close(); if (null != manager) manager.close(); }
public void close() throws BackendException { for (int i = 0; i < CONCURRENCY; i++) { store[i].close(); for (int j = 0; j < NUM_TX; j++) { log.debug("Committing tx[{}][{}] = {}", i, j, tx[i][j]); if (tx[i][j] != null) tx[i][j].commit(); } manager[i].close(); } LocalLockMediators.INSTANCE.clear(); }
public void close() throws BackendException { if (tx != null) tx.commit(); if (null != store1) store1.close(); if (null != store2) store2.close(); if (null != manager) manager.close(); }
public synchronized void close() throws BackendException { if (!hasAttemptedClose) { hasAttemptedClose = true; managementLogManager.close(); txLogManager.close(); userLogManager.close(); scanner.close(); if (edgeStore != null) edgeStore.close(); if (indexStore != null) indexStore.close(); if (idAuthority != null) idAuthority.close(); if (systemConfig != null) systemConfig.close(); if (userConfig != null) userConfig.close(); storeManager.close(); if(threadPool != null) { threadPool.shutdown(); } //Indexes for (IndexProvider index : indexes.values()) index.close(); } else { log.debug("Backend {} has already been closed or cleared", this); } }
public void testDataSequential() throws Exception { loadData(200000,2); close(); KeyColumnValueStoreManager manager = openStorageManager(); KeyColumnValueStore store = manager.openDatabase(Backend.EDGESTORE_NAME); SliceQuery query = new SliceQuery(BufferUtil.zeroBuffer(8),BufferUtil.oneBuffer(8)); query.setLimit(2); Stopwatch watch = Stopwatch.createStarted(); StoreTransaction txh = manager.beginTransaction(StandardBaseTransactionConfig.of(TimestampProviders.MILLI)); KeyIterator iterator = store.getKeys(query,txh); int numV = 0; while(iterator.hasNext()) { iterator.next(); RecordIterator<Entry> entries = iterator.getEntries(); assertEquals(2, Iterators.size(entries)); numV++; } iterator.close(); txh.commit(); System.out.println("Time taken: " + watch.elapsed(TimeUnit.MILLISECONDS)); System.out.println("Num Vertices: " + numV); store.close(); manager.close(); }
/** * Clears the storage of all registered backend data providers. This includes backend storage engines and index providers. * <p> * IMPORTANT: Clearing storage means that ALL data will be lost and cannot be recovered. * * @throws BackendException */ public synchronized void clearStorage() throws BackendException { if (!hasAttemptedClose) { hasAttemptedClose = true; managementLogManager.close(); txLogManager.close(); userLogManager.close(); scanner.close(); edgeStore.close(); indexStore.close(); idAuthority.close(); systemConfig.close(); userConfig.close(); storeManager.clearStorage(); storeManager.close(); //Indexes for (IndexProvider index : indexes.values()) { index.clearStorage(); index.close(); } } else { log.debug("Backend {} has already been closed or cleared", this); } }
@Test public void testClearStorage() throws Exception { final String[][] values = generateValues(); loadValues(values); close(); manager = openStorageManagerForClearStorageTest(); assertTrue("storage should exist before clearing", manager.exists()); manager.clearStorage(); try { assertFalse("storage should not exist after clearing", manager.exists()); } catch (Exception e) { // Retry to accommodate backends (e.g. BerkeleyDB) which may require a clean manager after clearing storage manager.close(); manager = openStorageManager(); assertFalse("storage should not exist after clearing", manager.exists()); } }