public DummyRawStoreControlledCommit() { objectStore = new ObjectStore(); }
@Before public void setUp() throws Exception { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setVar(conf, MetastoreConf.ConfVars.EXPRESSION_PROXY_CLASS, DefaultPartitionExpressionProxy.class.getName()); objectStore = new ObjectStore(); objectStore.setConf(conf); }
public static void main(String[] args) { HiveMetaToolCommandLine cl = HiveMetaToolCommandLine.parseArguments(args); ObjectStore objectStore = new ObjectStore(); objectStore.setConf(MetastoreConf.newMetastoreConf()); MetaToolTask task = null; try { if (cl.isListFSRoot()) { task = new MetaToolTaskListFSRoot(); } else if (cl.isExecuteJDOQL()) { task = new MetaToolTaskExecuteJDOQLQuery(); } else if (cl.isUpdateLocation()) { task = new MetaToolTaskUpdateLocation(); } else { throw new IllegalArgumentException("No task was specified!"); } task.setObjectStore(objectStore); task.setCommandLine(cl); task.execute(); } catch (Exception e) { LOGGER.error("Exception occured", e); } finally { objectStore.shutdown(); } } }
private ObjectStore createObjectStore() throws MetaException, InvalidOperationException { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true); MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CONNECTION_DRIVER, StatementVerifyingDerby.class.getName()); String jdbcUrl = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.CONNECT_URL_KEY); jdbcUrl = jdbcUrl.replace("derby","sderby"); MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CONNECT_URL_KEY,jdbcUrl); MetaStoreTestUtils.setConfForStandloneMode(conf); final ObjectStore objectStore = new ObjectStore(); objectStore.setConf(conf); HiveMetaStore.HMSHandler.createDefaultCatalog(objectStore, new Warehouse(conf)); return objectStore; }
@Ignore // See comment in ObjectStore.getDataSourceProps @Test public void testNonConfDatanucleusValueSet() { String key = "datanucleus.no.such.key"; String value = "test_value"; String key1 = "blabla.no.such.key"; String value1 = "another_value"; Assume.assumeTrue(System.getProperty(key) == null); Configuration localConf = MetastoreConf.newMetastoreConf(); MetaStoreTestUtils.setConfForStandloneMode(localConf); localConf.set(key, value); localConf.set(key1, value1); objectStore = new ObjectStore(); objectStore.setConf(localConf); Assert.assertEquals(value, PersistenceManagerProvider.getProperty(key)); Assert.assertNull(PersistenceManagerProvider.getProperty(key1)); }
@Test public void testCleanup() throws Exception { ObjectStore objStore = new ObjectStore(); objStore.setConf(metaStore.getConf()); objStore.deleteRuntimeStats(0); objStore.addRuntimeStat(createStat(1)); TimeUnit.SECONDS.sleep(6); objStore.addRuntimeStat(createStat(2)); int deleted = objStore.deleteRuntimeStats(5); assertEquals(1, deleted); List<RuntimeStat> all = getRuntimeStats(); assertEquals(1, all.size()); assertEquals(2, all.get(0).getWeight()); }
@Test public void testReading() throws Exception { ObjectStore objStore = new ObjectStore(); objStore.setConf(metaStore.getConf()); objStore.deleteRuntimeStats(0); objStore.addRuntimeStat(createStat(1)); Thread.sleep(1000); objStore.addRuntimeStat(createStat(2)); Thread.sleep(1000); objStore.addRuntimeStat(createStat(3)); List<RuntimeStat> g0 = client.getRuntimeStats(3, -1); assertEquals(1, g0.size()); assertEquals(3, g0.get(0).getWeight()); int ct = g0.get(0).getCreateTime(); List<RuntimeStat> g1 = client.getRuntimeStats(3, ct); assertEquals(2, g1.size()); assertEquals(2, g1.get(0).getWeight()); assertEquals(1, g1.get(1).getWeight()); int ct1 = g1.get(1).getCreateTime(); List<RuntimeStat> g2 = client.getRuntimeStats(3, ct1); assertEquals(0, g2.size()); }
public void testDirectSQLDropPartitionsCacheCrossSession() throws MetaException, InvalidObjectException, NoSuchObjectException, InvalidInputException { ObjectStore objectStore2 = new ObjectStore(); objectStore2.setConf(conf);
@Before public void setUp() throws Exception { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true); MetaStoreTestUtils.setConfForStandloneMode(conf); objectStore = new ObjectStore(); objectStore.setConf(conf); dropAllStoreObjects(objectStore); HiveMetaStore.HMSHandler.createDefaultCatalog(objectStore, new Warehouse(conf)); }
@Before public void setUp() throws Exception { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true); // Disable memory estimation for this test class MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CACHED_RAW_STORE_MAX_CACHE_MEMORY, "-1Kb"); MetaStoreTestUtils.setConfForStandloneMode(conf); objectStore = new ObjectStore(); objectStore.setConf(conf); cachedStore = new CachedStore(); cachedStore.setConfForTest(conf); // Stop the CachedStore cache update service. We'll start it explicitly to control the test CachedStore.stopCacheUpdateService(1); sharedCache = new SharedCache(); sharedCache.getDatabaseCache().clear(); sharedCache.getTableCache().clear(); sharedCache.getSdCache().clear(); // Create the 'hive' catalog HiveMetaStore.HMSHandler.createDefaultCatalog(objectStore, new Warehouse(conf)); }
ObjectStore store = new ObjectStore(); store.setConf(conf); ObjectStore store = new ObjectStore(); store.setConf(conf);
ObjectStore objStore = new ObjectStore(); try { objStore.validateTableCols(tbl, expectedCols);
/** * Test metastore configuration property METASTORE_MAX_EVENT_RESPONSE */ @Test public void testMaxEventResponse() throws InterruptedException, MetaException { NotificationEvent event = new NotificationEvent(0, 0, EventMessage.EventType.CREATE_DATABASE.toString(), ""); MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.METASTORE_MAX_EVENT_RESPONSE, 1); ObjectStore objs = new ObjectStore(); objs.setConf(conf); // Verify if METASTORE_MAX_EVENT_RESPONSE will limit number of events to respond for (int i = 0; i < 3; i++) { objs.addNotificationEvent(event); } NotificationEventResponse eventResponse = objs.getNextNotification(new NotificationEventRequest()); Assert.assertEquals(1, eventResponse.getEventsSize()); }
ObjectStore objStore = new ObjectStore();
@Before public void createObjectStore() throws MetaException, InvalidOperationException { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true); MetaStoreTestUtils.setConfForStandloneMode(conf); objectStore = new ObjectStore(); objectStore.setConf(conf); // Create three catalogs HiveMetaStore.HMSHandler.createDefaultCatalog(objectStore, new Warehouse(conf)); Catalog cat1 = new CatalogBuilder() .setName(CAT1_NAME) .setLocation("/tmp/cat1") .build(); objectStore.createCatalog(cat1); Catalog cat2 = new CatalogBuilder() .setName(CAT2_NAME) .setLocation("/tmp/cat2") .build(); objectStore.createCatalog(cat2); }
@Before public void setUp() throws Exception { conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.STATS_FETCH_BITVECTOR, false); MetaStoreTestUtils.setConfForStandloneMode(conf); store = new ObjectStore(); store.setConf(conf); dropAllStoreObjects(store); HiveMetaStore.HMSHandler.createDefaultCatalog(store, new Warehouse(conf)); HyperLogLog hll = HyperLogLog.builder().build(); hll.addLong(1); bitVectors[1] = hll.serialize(); hll = HyperLogLog.builder().build(); hll.addLong(2); hll.addLong(3); hll.addLong(3); hll.addLong(4); bitVectors[0] = hll.serialize(); }
private void initObjectStore(Configuration conf) { if (!isObjStoreInitialized) { objStore = new ObjectStore(); objStore.setConf(conf); isObjStoreInitialized = true; } }
var data = {"onlineUsers":[],"offlineUsers":["123.456.7.890:8080"]}; // Retrieve with an AJAX request var offlineUsers = array.map(data.offlineUsers, function(user) { return { host: user }; }); var store = new Memory({ data: offlineUsers }); var dataStore = new ObjectStore({objectStore: store});
private void initObjectStore(HiveConf hiveConf) { if (!isObjStoreInitialized) { objStore = new ObjectStore(); objStore.setConf(hiveConf); isObjStoreInitialized = true; } }
private void initObjectStore(HiveConf hiveConf) { if (!isObjStoreInitialized) { objStore = new ObjectStore(); objStore.setConf(hiveConf); isObjStoreInitialized = true; } }