public RowkeyQueryStatement(List<String> rowkeys,String serviceName) throws IllegalAccessException, InstantiationException { this.rowkeys = rowkeys; this.entityDefinition = EntityDefinitionManager.getEntityByServiceName(serviceName); }
public RowkeyQueryStatement(String rowkey,String serviceName) throws IllegalAccessException, InstantiationException { this.rowkeys = new ArrayList<>(1); this.rowkeys.add(rowkey); this.entityDefinition = EntityDefinitionManager.getEntityByServiceName(serviceName); }
public DeleteStatement(String serviceName) { try { this.entityDefinition = EntityDefinitionManager.getEntityByServiceName(serviceName); } catch (InstantiationException e) { throw new IllegalArgumentException(e); } catch (IllegalAccessException e) { throw new IllegalArgumentException(e); } }
public CreateStatement(List<? extends TaggedLogAPIEntity> entities,String serviceName) { this.entities = entities; try { this.entityDefinition = EntityDefinitionManager.getEntityByServiceName(serviceName); } catch (InstantiationException e) { throw new IllegalArgumentException(e); } catch (IllegalAccessException e) { throw new IllegalArgumentException(e); } }
public UpdateStatement(List<? extends TaggedLogAPIEntity> entities,String serviceName) { this.entities = entities; try { this.entityDefinition = EntityDefinitionManager.getEntityByServiceName(serviceName); } catch (InstantiationException e) { throw new IllegalArgumentException(e); } catch (IllegalAccessException e) { throw new IllegalArgumentException(e); } }
private void checkIsTimeSeries(String serviceName) throws Exception{ EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName(serviceName); if(!ed.isTimeSeries()){ throw new IllegalArgumentException("Multi-threading stream reader must be applied to time series table"); } }
private void checkIsTimeSeries(String serviceName) throws Exception { EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName(serviceName); if (!ed.isTimeSeries()) { throw new IllegalArgumentException("Multi-threading stream reader must be applied to time series table"); } }
public GenericEntityWriter(String serviceName) throws InstantiationException, IllegalAccessException { this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "serviceName"); }
public GenericEntityWriter(String serviceName) throws InstantiationException, IllegalAccessException{ this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "serviceName"); }
public GenericEntityScanStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException { this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }
public GenericEntityScanStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException{ this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }
private void checkEntityExistence(String entityName) throws EagleQueryParseException { try { if(EntityDefinitionManager.getEntityByServiceName(entityName) == null) throw new EagleQueryParseException(entityName + " entity does not exist!"); } catch (InstantiationException e) { final String errMsg = "Got an InstantiationException: " + e.getMessage(); throw new EagleQueryParseException(entityName + " entity does not exist! " + errMsg); } catch (IllegalAccessException e) { final String errMsg = "Got an IllegalAccessException: " + e.getMessage(); throw new EagleQueryParseException(entityName + " entity does not exist! " + errMsg); } }
public GenericEntityStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException { this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; this.readerAfterPlan = selectQueryReader(); }
public GenericEntityStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException{ this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; this.readerAfterPlan = selectQueryReader(); }
@Before public void setUp() { try { if (EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity") == null) { EntityDefinitionManager.registerEntity(TestLogAPIEntity.class); } ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity"); } catch (InstantiationException e) { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. } catch (IllegalAccessException e) { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. } }
@Test public void testGroupAggregateAvgClient() { try { EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity"); List<GroupbyKeyValue> result = client.aggregate(table, ed, scan, Arrays.asList("cluster", "datacenter"), Arrays.asList(AggregateFunctionType.avg), Arrays.asList("field2")).getKeyValues(); if (LOG.isDebugEnabled()) LOG.debug("AVG"); logGroupbyKeyValue(result); Assert.assertNotNull(result); Assert.assertTrue(result.size() > 0); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
@Test public void testGroupAggregateCountClient() { try { EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity"); List<GroupbyKeyValue> result = client.aggregate(table, ed, scan, Arrays.asList("cluster", "datacenter"), Arrays.asList(AggregateFunctionType.count), Arrays.asList("field2")).getKeyValues(); if (LOG.isDebugEnabled()) LOG.debug("COUNT"); logGroupbyKeyValue(result); Assert.assertNotNull(result); Assert.assertTrue(result.size() > 0); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
@Test public void testGroupAggregateMaxClient() { try { EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity"); List<GroupbyKeyValue> result = client.aggregate(table, ed, scan, Arrays.asList("cluster", "datacenter"), Arrays.asList(AggregateFunctionType.max), Arrays.asList("field1")).getKeyValues(); if (LOG.isDebugEnabled()) LOG.debug("MAX"); logGroupbyKeyValue(result); Assert.assertNotNull(result); Assert.assertTrue(result.size() > 0); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
@Test public void testGroupAggregateMinClient() { try { EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity"); List<GroupbyKeyValue> result = client.aggregate(table, ed, scan, Arrays.asList("cluster", "datacenter"), Arrays.asList(AggregateFunctionType.min), Arrays.asList("field2")).getKeyValues(); if (LOG.isDebugEnabled()) LOG.debug("MIN"); logGroupbyKeyValue(result); Assert.assertNotNull(result); Assert.assertTrue(result.size() > 0); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
@Test public void testScan() throws InstantiationException, IllegalAccessException { Assert.assertEquals(MetricMetadataEntity.class, EntityDefinitionManager .getEntityByServiceName("MetricMetadataService").getEntityClass()); } }