id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
29748259_1 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testGetColumnQualifier() {\n assertTrue(\"columnQualifier\".equals(hbaseColumn.getColumnQualifier()));\n }",
"class_method_signature": "HBaseColumnTest.testGetColumnQualifier()",
"constructor": false,
"full_signature": "@Test public void testGetColumnQualifier()",
"... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public String getColumnQualifier() {\n return columnQualifier;\n }",
"class_method_signature": "HBaseColumn.getColumnQualifier()",
"constructor": false,
"full_signature": "public String getColumnQualifier()",
"identifier": "getColumnQualifier",
"invocations": [],
"modifiers": "public"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_101 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/ConfigFileUtilTest.java",
"identifier": "ConfigFileUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isBinaryPersistenceEnabled() throws Exception {\n Map<String, String> properties = new HashMap<>(1);\n assertThat(ConfigFileUtil.isBinaryPersistenceEnabled(properties)).isFalse();\n\n properties.put(BINARY_PERSISTENCE_PROPERTY, Boolean.FALSE.toString());\n ... | {
"fields": [
{
"declarator": "CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator",
"modifier": "public static final",
"original_string": "public static final String CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator;",
"type": "String",
"var_name": "CONFIG_DI... | {
"body": "public static boolean isBinaryPersistenceEnabled(Map<String, String> properties) {\n return Boolean.valueOf(properties.getOrDefault(BINARY_PERSISTENCE_PROPERTY, Boolean.FALSE.toString()));\n }",
"class_method_signature": "ConfigFileUtil.isBinaryPersistenceEnabled(Map<String, String> properties)... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_10 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testCloseConnection() throws Exception {\n hbaseDataStore.closeConnection((HTable) null);\n hbaseDataStore.closeConnection((String) null);\n hbaseDataStore.closeConnection(htable);\n hbaseDataStore.closeConnection(\"tableName\");\n }",
"class_method_s... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void closeConnection(String tableName) {\n LOG.debug(\"Entering closeConnection(String tableName)\");\n HTableInterface htableResult = removeFromHtableMap(tableName);\n if (htableResult != null) {\n try {\n htableResult.close();\n } catch (IO... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_47 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testInsertTSDRLogRecordFailure() throws InterruptedException, ExecutionException, TimeoutException {\n String failureMessage = \"Failed to store record\";\n doReturn(RpcResultBuilder.failed().withError(ErrorType.APPLICATION, failureMessage).buildFuture())\n .... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(CollectorSPIImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(CollectorSPIImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Override\n public ListenableFuture<RpcResult<InsertTSDRLogRecordOutput>> insertTSDRLogRecord(InsertTSDRLogRecordInput input) {\n List<TSDRLogRecord> records = input.getTSDRLogRecord().stream().map(inputRec ->\n new TSDRLogRecordBuilder().setNodeID(inputRec.getNodeID())\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_46 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testInsertTSDRLogRecord() throws InterruptedException, ExecutionException, TimeoutException {\n doReturn(RpcResultBuilder.success(new StoreTSDRLogRecordOutputBuilder().build()).buildFuture())\n .when(logDataService).storeTSDRLogRecord(any());\n\n TSDRLogRecor... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(CollectorSPIImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(CollectorSPIImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Override\n public ListenableFuture<RpcResult<InsertTSDRLogRecordOutput>> insertTSDRLogRecord(InsertTSDRLogRecordInput input) {\n List<TSDRLogRecord> records = input.getTSDRLogRecord().stream().map(inputRec ->\n new TSDRLogRecordBuilder().setNodeID(inputRec.getNodeID())\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_11 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testFlushCommit() throws Exception {\n hbaseDataStore.flushCommit(\"tableName\");\n hbaseDataStore.flushCommit(null);\n }",
"class_method_signature": "HBaseDataStoreTest.testFlushCommit()",
"constructor": false,
"full_signature": "@Test public void testFlushCom... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void flushCommit(String tableName) {\n LOG.debug(\"Entering flushCommit(tableName)\");\n HTableInterface htableResult = getFromHtableMap(tableName);\n if (htableResult != null) {\n if (!autoFlush) {\n try {\n htableResult.flushCommits... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_0 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testGetColumnFamily() {\n assertTrue(\"columnFamily\".equals(hbaseColumn.getColumnFamily()));\n }",
"class_method_signature": "HBaseColumnTest.testGetColumnFamily()",
"constructor": false,
"full_signature": "@Test public void testGetColumnFamily()",
"identifier": "t... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public String getColumnFamily() {\n return columnFamily;\n }",
"class_method_signature": "HBaseColumn.getColumnFamily()",
"constructor": false,
"full_signature": "public String getColumnFamily()",
"identifier": "getColumnFamily",
"invocations": [],
"modifiers": "public",
"parameters... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_100 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/ConfigFileUtilTest.java",
"identifier": "ConfigFileUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isLogPersistenceEnabled() throws Exception {\n Map<String, String> properties = new HashMap<>(1);\n assertThat(ConfigFileUtil.isLogPersistenceEnabled(properties)).isFalse();\n\n properties.put(LOG_PERSISTENCE_PROPERTY, Boolean.FALSE.toString());\n assertTh... | {
"fields": [
{
"declarator": "CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator",
"modifier": "public static final",
"original_string": "public static final String CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator;",
"type": "String",
"var_name": "CONFIG_DI... | {
"body": "public static boolean isLogPersistenceEnabled(Map<String, String> properties) {\n return Boolean.valueOf(properties.getOrDefault(LOG_PERSISTENCE_PROPERTY, Boolean.FALSE.toString()));\n }",
"class_method_signature": "ConfigFileUtil.isLogPersistenceEnabled(Map<String, String> properties)",
"con... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_50 | {
"fields": [
{
"declarator": "configObject = new TSDRRestconfCollectorConfig()",
"modifier": "private final",
"original_string": "private final TSDRRestconfCollectorConfig configObject = new TSDRRestconfCollectorConfig();",
"type": "TSDRRestconfCollectorConfig",
"var_name": "configO... | {
"body": "@Test(expected = ConfigurationException.class)\n public void testUnrecognizedMethod() throws ConfigurationException {\n Dictionary<String, String> properties = new Hashtable<>();\n\n properties.put(METHODS_TO_LOG, \"GERT,PUT\");\n\n configObject.updated(properties);\n }",
"clas... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n @SuppressFBWarnings(\"RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT\")\n @Override\n public synchronized void updated(Dictionary properties) throws ConfigurationException {\n parseProperties(properties);\n\n LOG.info(\"TSDRRestconfCollect... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_93 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testPurgeAllTSDRRecords() throws SQLException {\n impl.purge(0L);\n for (DataCategory dc : DataCategory.values()) {\n Mockito.verify(store, Mockito.atLeast(1)).purge(dc, 0L);\n }\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImplTes... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void purge(DataCategory category, long retentionTime) {\n LOG.info(\"Execute Purge with Category {} and earlier than {}.\", category.name(), new Date(retentionTime));\n try {\n store.purge(category, retentionTime);\n } catch (SQLException e) {\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_85 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void runOneIteration() throws Exception {\n TSDRMetricRecord record = TsdrRecordFactory.createMetricRecord();\n Mockito.doReturn(null).when(CLIENT).execute(Mockito.any(Bulk.class));\n store.store(record);\n store.runOneIteration();\n Mockito.verify(CLIEN... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n protected void runOneIteration() throws Exception {\n sync();\n }",
"class_method_signature": "ElasticSearchStore.runOneIteration()",
"constructor": false,
"full_signature": "@Override protected void runOneIteration()",
"identifier": "runOneIteration",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_27 | {
"fields": [
{
"declarator": "contextService = new HBaseDataStoreContext()",
"modifier": "private final",
"original_string": "private final HBaseDataStoreContext contextService = new HBaseDataStoreContext();",
"type": "HBaseDataStoreContext",
"var_name": "contextService"
}
],
... | {
"body": "@Test\n public void testGetAutoFlush() {\n assertFalse(contextService.getAutoFlush());\n }",
"class_method_signature": "HBaseDataStoreContextTest.testGetAutoFlush()",
"constructor": false,
"full_signature": "@Test public void testGetAutoFlush()",
"identifier": "testGetAutoFlush",
"in... | {
"fields": [
{
"declarator": "ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\"",
"modifier": "static final",
"original_string": "static final String ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\";",
"type": "String",
"var_name": "ZOO_KEEPER_QUORUM_PROP"
},
{
"declarator"... | {
"body": "public boolean getAutoFlush() {\n return this.autoFlush;\n }",
"class_method_signature": "HBaseDataStoreContext.getAutoFlush()",
"constructor": false,
"full_signature": "public boolean getAutoFlush()",
"identifier": "getAutoFlush",
"invocations": [],
"modifiers": "public",
"paramete... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_70 | {
"fields": [
{
"declarator": "store = Mockito.mock(ElasticSearchStore.class)",
"modifier": "private final",
"original_string": "private final ElasticSearchStore store = Mockito.mock(ElasticSearchStore.class);",
"type": "ElasticSearchStore",
"var_name": "store"
},
{
"de... | {
"body": "@Test\n public void getTSDRMetricRecords() throws Exception {\n long start = 0L;\n long end = 0L;\n int size = 1000;\n String key = DataCategory.EXTERNAL.name();\n ElasticSearchStore.RecordType type = ElasticSearchStore.RecordType.METRIC;\n service.getTSDRMetric... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) {\n return getTSDRRecords(RecordType.METRIC, key, start, end);\n }",
"class_method_signature": "TsdrElasticSearchPersistenceServiceImpl.getTSDRMetricRecords(String key, long start, long end)",
... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_89 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testStoreLog() throws SQLException {\n TSDRLogRecord logRecord = HsqlDBStoreTest.createLogRecord();\n impl.storeLog(logRecord);\n Mockito.verify(store, Mockito.atLeast(1)).store(logRecord);\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImplTes... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void storeLog(TSDRLogRecord logRecord) {\n try {\n store.store(logRecord);\n } catch (SQLException e) {\n LOG.error(\"Failed to store record to database\", e);\n }\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImpl.storeLo... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_66 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testAddMetricsWithServiceInInput() {\n AddMetricInputBuilder input = new AddMetricInputBuilder();\n input.setMetricName(\"Test\");\n input.setMetricValue(new BigDecimal(10));\n input.setNodeID(\"Test\");\n input.setTimeStamp(System.currentTimeMillis... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public ListenableFuture<RpcResult<AddMetricOutput>> addMetric(AddMetricInput input) {\n TSDRMetricRecordBuilder builder = new TSDRMetricRecordBuilder();\n builder.setMetricName(input.getMetricName());\n builder.setMetricValue(input.getMetricValue());\n builder.set... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_31 | {
"fields": [
{
"declarator": "POLL_INTERVAL = 100",
"modifier": "private static final",
"original_string": "private static final long POLL_INTERVAL = 100;",
"type": "long",
"var_name": "POLL_INTERVAL"
},
{
"declarator": "mockSpiService = mock(TsdrCollectorSpiService.cl... | {
"body": "@Test\n public void testCollectMetricsSansCPUData() {\n try (ControllerMetricCollector collector = new ControllerMetricCollector(mockSpiService,\n mockSchedulerService, CpuDataCollector.getNullCpuDataCollector(), POLL_INTERVAL)) {\n collector.init();\n\n runSc... | {
"fields": [
{
"declarator": "MACHINE_ID = \"Machine\"",
"modifier": "static final",
"original_string": "static final String MACHINE_ID = \"Machine\";",
"type": "String",
"var_name": "MACHINE_ID"
},
{
"declarator": "CONTROLLER_ID = \"Controller\"",
"modifier": "s... | {
"body": "@PostConstruct\n public void init() {\n scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval);\n LOG.info(\"Controller Metrics Collector started\");\n }",
"class_method_signature": "ControllerMetricCollector.init()",
"constructor": false,... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_82 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void buildQueryStringOfLog() throws Exception {\n String result = store.buildQueryString(ElasticSearchStore.RecordType.LOG, \"FLOWSTATS\");\n assertThat(result.contains(TsdrRecordPayload.ELK_DATA_CATEGORY + \":\\\\\\\"FLOWSTATS\\\\\\\"\")).isTrue();\n\n result = store... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "String buildQueryString(RecordType type, String tsdrKey) {\n StringBuffer queryBuffer = new StringBuffer();\n appendCondition(queryBuffer, TsdrRecordPayload.ELK_DATA_CATEGORY, resolveDataCategory(tsdrKey));\n\n try {\n Long timestamp = FormatUtil.getTimeStampFromTSDRKey(tsdr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_94 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testGetTSDRMetricRecords() throws SQLException {\n impl.getTSDRMetricRecords(\"Test\",0L,0L);\n Mockito.verify(store,Mockito.atLeastOnce()).getTSDRMetricRecords(\"Test\",0L,0L,1000);\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImplTest.testGetTSDRM... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public List<TSDRMetricRecord> getTSDRMetricRecords(String tsdrMetricKey, long startDateTime, long endDateTime) {\n try {\n return store.getTSDRMetricRecords(tsdrMetricKey, startDateTime, endDateTime,\n TSDRConstants.MAX_RESULTS_FROM_LIST_METRICS_COMMAND);... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_57 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testStoreMetric() {\n TSDRMetricRecord metricRecord = CassandraStoreTest.createMetricRecord();\n impl.storeMetric(metricRecord);\n Mockito.verify(store, Mockito.atLeast(1)).store(metricRecord);\n }",
"class_method_signature": "TSDRCassandraPersistenceService... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void storeMetric(TSDRMetricRecord metricRecord) {\n store.startBatch();\n store.store(metricRecord);\n store.executeBatch();\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImpl.storeMetric(TSDRMetricRecord metricRecord)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_7 | {
"fields": [
{
"declarator": "mockSchedulerService = mock(SchedulerService.class)",
"modifier": "private final",
"original_string": "private final SchedulerService mockSchedulerService = mock(SchedulerService.class);",
"type": "SchedulerService",
"var_name": "mockSchedulerService"
... | {
"body": "@Test\n public void testRun() throws IOException {\n tableService.start();\n verify(mockSchedulerService).scheduleTask(tableService);\n tableService.run();\n\n assertTrue(tableService.completionFuture().isDone());\n verify(mockDataStore).createTable(\"table1\");\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(CreateTableTask.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(CreateTableTask.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"de... | {
"body": "@Override\n public void run() {\n String oldName = Thread.currentThread().getName();\n Thread.currentThread().setName(\"TSDR HBase Data Store CreateTableTask\");\n\n try {\n createTables();\n } finally {\n Thread.currentThread().setName(oldName);\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_107 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsValidTSDRLogKey() {\n String key = FormatUtil.getTSDRLogKey(createLogRecord());\n Assert.assertTrue(FormatUtil.isValidTSDRLogKey(key));\n }",
"class_method_signature": "FormatUtilTest.testIsValidTSDRLogKey()",
"constructor": false,
"full_signature": "@Tes... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static boolean isValidTSDRLogKey(String str) {\n if (getDataCategoryFromTSDRKey(str) == null) {\n return false;\n }\n if (getNodeIdFromTSDRKey(str) == null) {\n return false;\n }\n if (getRecordKeysFromTSDRKey(str) == null) {\n retu... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_16 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testDeleteByTimestamp() throws Exception {\n hbaseDataStore.deleteByTimestamp(\"tableName\", 0L);\n }",
"class_method_signature": "HBaseDataStoreTest.testDeleteByTimestamp()",
"constructor": false,
"full_signature": "@Test public void testDeleteByTimestamp()",
"iden... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void deleteByTimestamp(String tableName, long timestamp) throws IOException {\n LOG.info(\"YuLing == entering deleteByTimestamp \");\n int batchSize = 500;\n List<Delete> deleteList = new ArrayList<>();\n Scan scan = new Scan();\n scan.setTimeRange(Long.MIN_VALUE, ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_111 | {
"fields": [
{
"declarator": "TSDR_TEST_KEY = \"[NID=openflow:1][DC=EXTERNAL][MN=Memory][RK=hello:world,Testing:test]\"",
"modifier": "private static final",
"original_string": "private static final String TSDR_TEST_KEY = \"[NID=openflow:1][DC=EXTERNAL][MN=Memory][RK=hello:world,Testing:test]\"... | {
"body": "@Test\n public void testAddTsdrCacheEntry() {\n TSDRCacheEntry entry = keyCache.addTSDRCacheEntry(TSDR_TEST_KEY);\n Assert.assertEquals(\"openflow:1\", entry.getNodeID());\n Assert.assertEquals(DataCategory.EXTERNAL, entry.getDataCategory());\n Assert.assertEquals(\"Memory\",... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRKeyCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRKeyCache.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "public final TSDRCacheEntry addTSDRCacheEntry(final String tsdrKey) {\n return addTSDRCacheEntry(tsdrKey,true);\n }",
"class_method_signature": "TSDRKeyCache.addTSDRCacheEntry(final String tsdrKey)",
"constructor": false,
"full_signature": "public final TSDRCacheEntry addTSDRCacheEntry(fina... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_41 | {
"fields": [
{
"declarator": "FILE_NAME = \"./etc/tsdr-log-collector.properties\"",
"modifier": "private static final",
"original_string": "private static final String FILE_NAME = \"./etc/tsdr-log-collector.properties\";",
"type": "String",
"var_name": "FILE_NAME"
},
{
... | {
"body": "@Test\n public void testDoAppend() {\n long time = System.currentTimeMillis();\n final TsdrLogCollector tsdrLogCollector =\n new TsdrLogCollector(tsdrLogCollectorLogger, new TsdrLogCollectorConfig(FILE_NAME));\n\n // create a log\n LogEvent logEvent = new LogEv... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(TsdrLogCollector.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(TsdrLogCollector.class);",
"type": "Logger",
"var_name"... | {
"body": "public void doAppend(PaxLoggingEvent event) {\n if (inLogAppender.get() == null) {\n try {\n inLogAppender.set(Boolean.TRUE);\n appendToTsdr(event);\n }\n finally {\n inLogAppender.remove();\n }\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_36 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/v5/NetflowV5PacketParserTest.java",
"identifier": "NetflowV5PacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testFlowRecords() throws IOException {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(5); // version\n out.writeShort(2); // count\n ... | {
"fields": [
{
"declarator": "LOG_RECORD_TEXT = \"Flow record\"",
"modifier": "static final",
"original_string": "static final String LOG_RECORD_TEXT = \"Flow record\";",
"type": "String",
"var_name": "LOG_RECORD_TEXT"
},
{
"declarator": "LOG = LoggerFactory.getLogger(... | {
"body": "@Override\n public void parseRecords() {\n for (int i = 0; i < totalRecordCount; i++) {\n parseNextRecord();\n }\n }",
"class_method_signature": "NetflowV5PacketParser.parseRecords()",
"constructor": false,
"full_signature": "@Override public void parseRecords()",
"id... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_61 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testPurgeTSDRRecords() {\n impl.purge(DataCategory.QUEUESTATS,0L);\n Mockito.verify(store,Mockito.atLeast(1)).purge(DataCategory.QUEUESTATS,0L);\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImplTest.testPurgeTSDRRecords()",
"constructor": false... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void purge(DataCategory category, long retentionTime) {\n LOG.info(\"Execute Purge with Category {} and earlier than {}.\",category.name(),new Date(retentionTime));\n store.purge(category,retentionTime);\n }",
"class_method_signature": "TSDRCassandraPersistenceServi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_98 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/ConfigFileUtilTest.java",
"identifier": "ConfigFileUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void loadConfig() throws Exception {\n String content = \"\"\n + METRIC_PERSISTENCE_PROPERTY + \"=\" + Boolean.TRUE.toString() + \"\\n\"\n + LOG_PERSISTENCE_PROPERTY + \"=\" + Boolean.TRUE.toString() + \"\\n\"\n + BINARY_PERSISTENCE_PROP... | {
"fields": [
{
"declarator": "CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator",
"modifier": "public static final",
"original_string": "public static final String CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator;",
"type": "String",
"var_name": "CONFIG_DI... | {
"body": "public static Map<String, String> loadConfig(String config) throws IOException {\n Properties properties = new Properties();\n properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream());\n return Maps.fromProperties(properties);\n }",
"class_method_... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_77 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test(expected = NullPointerException.class)\n public void storeAllNullRecord() throws Exception {\n store.storeAll(null);\n }",
"class_method_signature": "ElasticSearchStoreTest.storeAllNullRecord()",
"constructor": false,
"full_signature": "@Test(expected = NullPointerException.class) ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void storeAll(List<? extends TSDRRecord> records) {\n checkNotNull(records);\n\n // check whether content of the list doesn't contain a null value.\n for (TSDRRecord record : records) {\n checkNotNull(record);\n }\n checkState(isRunning(), \"The service is not ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_20 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test(expected = TableNotFoundException.class)\n public void testCreateEntityException() throws TableNotFoundException {\n HBaseEntity dentity = new HBaseEntity();\n dentity.setRowKey(\"rowKey1\");\n dentity.setTableName(\"tableName1\");\n HBaseColumn column = new HBaseColumn... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HBaseEntity create(final HBaseEntity entity) throws TableNotFoundException {\n LOG.debug(\"Entering create(HBaseEntity entity)\");\n if (entity != null && entity.getRowKey() != null) {\n Put put = new Put(Bytes.toBytes(entity.getRowKey()));\n for (HBaseColumn curr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_21 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test(expected = TableNotFoundException.class)\n public void testCreateEntityListException() throws TableNotFoundException {\n HBaseEntity dentity = new HBaseEntity();\n dentity.setRowKey(\"rowKey1\");\n dentity.setTableName(\"tableName1\");\n HBaseColumn column = new HBaseCo... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HBaseEntity create(final HBaseEntity entity) throws TableNotFoundException {\n LOG.debug(\"Entering create(HBaseEntity entity)\");\n if (entity != null && entity.getRowKey() != null) {\n Put put = new Put(Bytes.toBytes(entity.getRowKey()));\n for (HBaseColumn curr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_99 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/ConfigFileUtilTest.java",
"identifier": "ConfigFileUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isMetricPersistenceEnabled() throws Exception {\n Map<String, String> properties = new HashMap<>(1);\n assertThat(ConfigFileUtil.isMetricPersistenceEnabled(properties)).isFalse();\n\n properties.put(METRIC_PERSISTENCE_PROPERTY, Boolean.FALSE.toString());\n ... | {
"fields": [
{
"declarator": "CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator",
"modifier": "public static final",
"original_string": "public static final String CONFIG_DIR = \".\" + File.separator + \"etc\" + File.separator;",
"type": "String",
"var_name": "CONFIG_DI... | {
"body": "public static boolean isMetricPersistenceEnabled(Map<String, String> properties) {\n return Boolean.valueOf(properties.getOrDefault(METRIC_PERSISTENCE_PROPERTY, Boolean.FALSE.toString()));\n }",
"class_method_signature": "ConfigFileUtil.isMetricPersistenceEnabled(Map<String, String> properties)... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_76 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void storeAll() throws Exception {\n ArrayList<TSDRRecord> records = Lists.newArrayList(\n TsdrRecordFactory.createMetricRecord(),\n TsdrRecordFactory.createLogRecord());\n store.storeAll(records);\n assertThat(store.getBatch()).isNotEmpt... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void storeAll(List<? extends TSDRRecord> records) {\n checkNotNull(records);\n\n // check whether content of the list doesn't contain a null value.\n for (TSDRRecord record : records) {\n checkNotNull(record);\n }\n checkState(isRunning(), \"The service is not ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_60 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testLogStoreList() {\n List<TSDRLogRecord> list = new ArrayList<>(2);\n TSDRLogRecord logRecord = CassandraStoreTest.createLogRecord();\n list.add(logRecord);\n impl.storeLog(list);\n Mockito.verify(store, Mockito.atLeast(1)).store(logRecord);\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void storeLog(TSDRLogRecord logRecord) {\n store.startBatch();\n store.store(logRecord);\n store.executeBatch();\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImpl.storeLog(TSDRLogRecord logRecord)",
"constructor": false,
"full_signature... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_37 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/ipfix/NetflowIPFIXPacketParserTest.java",
"identifier": "NetflowIPFIXPacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testDataRecords() throws IOException {\n // First packet - 2 templates, 2 data records\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(10); // ... | {
"fields": [
{
"declarator": "DATA_RECORD_TEXT = \"Data Record\"",
"modifier": "static final",
"original_string": "static final String DATA_RECORD_TEXT = \"Data Record\";",
"type": "String",
"var_name": "DATA_RECORD_TEXT"
},
{
"declarator": "LOG = LoggerFactory.getLogg... | {
"body": "@Override\n public void parseRecords() {\n while (position() < totalPacketLength && !endOfData()) {\n if (!parseNextRecords()) {\n break;\n }\n }\n\n missingTemplateCache.checkTemplates();\n }",
"class_method_signature": "NetflowIPFIXPacketP... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_40 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/ipfix/NetflowIPFIXPacketParserTest.java",
"identifier": "NetflowIPFIXPacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testMissingOptionsTemplate() throws IOException {\n // First packet - options data record with missing template\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writ... | {
"fields": [
{
"declarator": "DATA_RECORD_TEXT = \"Data Record\"",
"modifier": "static final",
"original_string": "static final String DATA_RECORD_TEXT = \"Data Record\";",
"type": "String",
"var_name": "DATA_RECORD_TEXT"
},
{
"declarator": "LOG = LoggerFactory.getLogg... | {
"body": "@Override\n public void parseRecords() {\n while (position() < totalPacketLength && !endOfData()) {\n if (!parseNextRecords()) {\n break;\n }\n }\n\n missingTemplateCache.checkTemplates();\n }",
"class_method_signature": "NetflowIPFIXPacketP... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_17 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testConvertResultToEntity() {\n HBaseDataStore hbasedatastore = new HBaseDataStore();\n hbasedatastore.convertResultToEntity(\"tableName\", (Result) null);\n hbasedatastore.convertResultToEntity(\"tableName\", result);\n }",
"class_method_signature": "HBaseD... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HBaseEntity convertResultToEntity(String tableName, Result result) {\n if (result == null) {\n return null;\n }\n HBaseEntity resultEntity = new HBaseEntity();\n resultEntity.setTableName(tableName);\n resultEntity.setRowKey(Bytes.toString(result.getRow(... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_110 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/GenerateKeyTest.java",
"identifier": "GenerateKeyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenerateKey() {\n File file = new File(GenerateKey.KEY_FILE_NAME);\n if (file.exists()) {\n file.delete();\n }\n GenerateKey.main(null);\n file = new File(GenerateKey.KEY_FILE_NAME);\n Assert.assertTrue(file.exists());\n }",... | {
"fields": [
{
"declarator": "KEY_ENCRYPTION_SIZE = 128",
"modifier": "public static final",
"original_string": "public static final int KEY_ENCRYPTION_SIZE = 128;",
"type": "int",
"var_name": "KEY_ENCRYPTION_SIZE"
},
{
"declarator": "KEY_METHOD = \"AES\"",
"modi... | {
"body": "private GenerateKey(){\n }",
"class_method_signature": "GenerateKey.GenerateKey()",
"constructor": true,
"full_signature": "private GenerateKey()",
"identifier": "GenerateKey",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " GenerateKey()",
... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_6 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testSetTimeStamp() {\n hbaseColumn.setTimeStamp(1000);\n assertTrue(hbaseColumn.getTimeStamp() == 1000);\n }",
"class_method_signature": "HBaseColumnTest.testSetTimeStamp()",
"constructor": false,
"full_signature": "@Test public void testSetTimeStamp()",
"ide... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public void setTimeStamp(long timeStamp) {\n this.timeStamp = timeStamp;\n }",
"class_method_signature": "HBaseColumn.setTimeStamp(long timeStamp)",
"constructor": false,
"full_signature": "public void setTimeStamp(long timeStamp)",
"identifier": "setTimeStamp",
"invocations": [],
"mo... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_106 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTSDRMetricKeyWithTimeStamp() {\n String key = FormatUtil.getTSDRMetricKeyWithTimeStamp(createMetricRecord());\n List<RecordKeys> list = FormatUtil.getRecordKeysFromTSDRKey(key);\n Assert.assertEquals(list.size(), 1);\n Assert.assertEquals(\"Test2\",... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static String getTSDRMetricKeyWithTimeStamp(TSDRMetric metric) {\n StringBuilder sb = new StringBuilder(getTSDRMetricKey(metric));\n sb.append(KEY_TIMESTAMP);\n sb.append(metric.getTimeStamp());\n sb.append(\"]\");\n return sb.toString();\n }",
"class_method_s... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_56 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testPurge() {\n store.store(createMetricRecord());\n Assert.assertEquals(1,store.getBatch().size());\n store.purge(DataCategory.EXTERNAL,0L);\n Mockito.verify(session,Mockito.atLeast(1)).execute(Mockito.anyString());\n }",
"class_method_signature": "C... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(CassandraStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(CassandraStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void purge(DataCategory category, long retentionTime) {\n purgeMetrics(category,retentionTime);\n purgeLogs(category,retentionTime);\n purgeBinary(category,retentionTime);\n }",
"class_method_signature": "CassandraStore.purge(DataCategory category, long retentionTime)",
"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_95 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testGetTSDRLogRecords() throws SQLException {\n impl.getTSDRLogRecords(\"Test\",0L,0L);\n Mockito.verify(store,Mockito.atLeastOnce()).getTSDRLogRecords(\"Test\",0L,0L,1000);\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImplTest.testGetTSDRLogRecords... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public List<TSDRLogRecord> getTSDRLogRecords(String tsdrMetricKey, long startTime, long endTime) {\n try {\n return store.getTSDRLogRecords(tsdrMetricKey, startTime, endTime,\n TSDRConstants.MAX_RESULTS_FROM_LIST_METRICS_COMMAND);\n } catch (SQLExc... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_83 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void buildQueryStringOfMetric() throws Exception {\n String result = store.buildQueryString(ElasticSearchStore.RecordType.METRIC, \"FLOWSTATS\");\n assertThat(result.contains(TsdrRecordPayload.ELK_DATA_CATEGORY)).isTrue();\n assertThat(result.contains(TsdrRecordPayloa... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "String buildQueryString(RecordType type, String tsdrKey) {\n StringBuffer queryBuffer = new StringBuffer();\n appendCondition(queryBuffer, TsdrRecordPayload.ELK_DATA_CATEGORY, resolveDataCategory(tsdrKey));\n\n try {\n Long timestamp = FormatUtil.getTimeStampFromTSDRKey(tsdr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_43 | {
"fields": [
{
"declarator": "loggerObject",
"modifier": "private",
"original_string": "private TsdrLogCollectorLogger loggerObject;",
"type": "TsdrLogCollectorLogger",
"var_name": "loggerObject"
},
{
"declarator": "tsdrCollectorSpiService",
"modifier": "@Mock\n ... | {
"body": "@Test\n public void testStorageProcess() {\n // First, we try inserting a log\n long time = System.currentTimeMillis();\n loggerObject.insertLog(\"org.opendaylight.test\", time, \"test\", \"this is a test\");\n loggerObject.insertLog(\"org.opendaylight.test2\", time, \"test2\... | {
"fields": [],
"file": "collectors/log-collector/src/main/java/org/opendaylight/tsdr/log/TsdrLogCollectorLogger.java",
"identifier": "TsdrLogCollectorLogger",
"interfaces": "",
"methods": [
{
"class_method_signature": "TsdrLogCollectorLogger.TsdrLogCollectorLogger(TsdrCollectorSpiService tsdrCollec... | {
"body": "public void insertLog(String loggerName, long timeStamp, String level, String message) {\n super.insertLog(loggerName, timeStamp, \"LEVEL=\" + level + \",MESSAGE=\" + message, DataCategory.ODLLOG);\n }",
"class_method_signature": "TsdrLogCollectorLogger.insertLog(String loggerName, long timeSta... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_113 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/command/ListMetricsCommandTest.java",
"identifier": "ListMetricsCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n final TSDRMetricPersistenceService metricService = Mockito.mock(TSDRMetricPersistenceService.class);\n final TSDRLogPersistenceService logService = Mockito.mock(TSDRLogPersistenceService.class);\n ListMetricsCommand cmd = new ListMetri... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ListMetricsCommand.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ListMetricsCommand.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n @SuppressWarnings(\"checkstyle:RegexpSingleLineJava\")\n public Object execute() throws Exception {\n PrintStream ps = this.session != null ? this.session.getConsole() : System.out;\n\n long startDate = 0;\n long endDate = Long.MAX_VALUE;\n if (startDateTime !=... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_14 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testCreateEntity() throws Exception {\n HBaseEntity dentity = new HBaseEntity();\n dentity.setRowKey(\"rowKey1\");\n dentity.setTableName(\"tableName1\");\n HBaseColumn column = new HBaseColumn();\n column.setColumnFamily(TsdrHBaseDataStoreConstants... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HBaseEntity create(final HBaseEntity entity) throws TableNotFoundException {\n LOG.debug(\"Entering create(HBaseEntity entity)\");\n if (entity != null && entity.getRowKey() != null) {\n Put put = new Put(Bytes.toBytes(entity.getRowKey()));\n for (HBaseColumn curr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_105 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTSDRLogKeyWithTimeStamp() {\n String key = FormatUtil.getTSDRLogKeyWithTimeStamp(createLogRecord());\n List<RecordKeys> list = FormatUtil.getRecordKeysFromTSDRKey(key);\n Assert.assertEquals(list.size(), 1);\n Assert.assertEquals(\"Test2\", list.get... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static String getTSDRLogKeyWithTimeStamp(TSDRLog log) {\n StringBuilder sb = new StringBuilder(getTSDRLogKey(log));\n sb.append(KEY_TIMESTAMP);\n sb.append(log.getTimeStamp());\n sb.append(\"]\");\n return sb.toString();\n }",
"class_method_signature": "Format... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_5 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testSetValue() {\n hbaseColumn.setValue(\"newvalue\");\n assertTrue(\"newvalue\".equals(hbaseColumn.getValue()));\n }",
"class_method_signature": "HBaseColumnTest.testSetValue()",
"constructor": false,
"full_signature": "@Test public void testSetValue()",
"id... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public void setValue(String value) {\n this.value = value;\n }",
"class_method_signature": "HBaseColumn.setValue(String value)",
"constructor": false,
"full_signature": "public void setValue(String value)",
"identifier": "setValue",
"invocations": [],
"modifiers": "public",
"paramet... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_55 | {
"fields": [
{
"declarator": "loggerObject",
"modifier": "private",
"original_string": "private TSDRRestconfCollectorLogger loggerObject;",
"type": "TSDRRestconfCollectorLogger",
"var_name": "loggerObject"
},
{
"declarator": "tsdrCollectorSpiService",
"modifier":... | {
"body": "@Test\n public void testStorageProcess() {\n // First, we try inserting two logs\n\n loggerObject.insertLog(\"GET\", \"/restconf/path1\", \"10.0.0.1\", \"body1\");\n loggerObject.insertLog(\"POST\", \"/restconf/path2\", \"10.0.0.2\", \"body2\");\n runnableCaptor.getValue().ru... | {
"fields": [],
"file": "collectors/restconf-collector/src/main/java/org/opendaylight/tsdr/restconf/collector/TSDRRestconfCollectorLogger.java",
"identifier": "TSDRRestconfCollectorLogger",
"interfaces": "",
"methods": [
{
"class_method_signature": "TSDRRestconfCollectorLogger.TSDRRestconfCollectorL... | {
"body": "public void insertLog(String method, String pathInfo, String remoteAddress, String body) {\n super.insertLog(pathInfo, System.currentTimeMillis(),\n \"METHOD=\" + method + \",REMOTE_ADDRESS=\" + remoteAddress + \",BODY=\" + body,\n DataCategory.RESTCONF);\n }",
"cl... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_79 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void search() throws Exception {\n Mockito.doReturn(EMPTY_SEARCH_RESULT).when(CLIENT).execute(Mockito.any(Search.class));\n List<TSDRRecord> result = store.search(\n ElasticSearchStore.RecordType.METRIC,\n DataCategory.EXTERNAL.name(),\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@SuppressWarnings(\"unchecked\")\n <T extends TSDRRecord> List<T> search(RecordType type, String key, long start, long end, int size) {\n checkNotNull(type);\n checkNotNull(key);\n checkState(isRunning(), \"The service is not running\");\n\n if (end < start) {\n re... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_96 | {
"fields": [
{
"declarator": "connection = Mockito.mock(Connection.class)",
"modifier": "private final",
"original_string": "private final Connection connection = Mockito.mock(Connection.class);",
"type": "Connection",
"var_name": "connection"
},
{
"declarator": "state... | {
"body": "@Test\n public void testPurge() throws SQLException {\n store.store(createMetricRecord());\n Mockito.verify(statement, Mockito.atLeast(1)).execute(Mockito.anyString());\n store.purge(DataCategory.EXTERNAL, 0L);\n Mockito.verify(statement, Mockito.atLeast(1)).execute(Mockito.a... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HsqlDBStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HsqlDBStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "public void purge(DataCategory category, long retentionTime) throws SQLException {\n purgeMetrics(category, retentionTime);\n purgeLogs(category, retentionTime);\n }",
"class_method_signature": "HsqlDBStore.purge(DataCategory category, long retentionTime)",
"constructor": false,
"ful... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_80 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void appendCondition() throws Exception {\n StringBuffer buffer = new StringBuffer();\n\n store.appendCondition(buffer, \"empty1\", null);\n assertThat(buffer.toString()).isEqualTo(\"\");\n\n store.appendCondition(buffer, \"empty2\", null);\n assertThat(... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void appendCondition(StringBuffer queryBuffer, String fieldName, String fieldValue) {\n if (StringUtils.isNoneEmpty(fieldValue)) {\n // If it is not the first condition then we must add clausule And\n if (queryBuffer.length() > 0) {\n queryBuffer.append(\" AND \"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_38 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/ipfix/NetflowIPFIXPacketParserTest.java",
"identifier": "NetflowIPFIXPacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testMissingDataRecordTemplate() throws IOException {\n\n // First packet - data record with missing template\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeSh... | {
"fields": [
{
"declarator": "DATA_RECORD_TEXT = \"Data Record\"",
"modifier": "static final",
"original_string": "static final String DATA_RECORD_TEXT = \"Data Record\";",
"type": "String",
"var_name": "DATA_RECORD_TEXT"
},
{
"declarator": "LOG = LoggerFactory.getLogg... | {
"body": "@Override\n public void parseRecords() {\n while (position() < totalPacketLength && !endOfData()) {\n if (!parseNextRecords()) {\n break;\n }\n }\n\n missingTemplateCache.checkTemplates();\n }",
"class_method_signature": "NetflowIPFIXPacketP... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_18 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test(expected = TableNotFoundException.class)\n public void testDeleteByTimestampException() throws IOException {\n HBaseDataStore hbasedatastore1 = null;\n hbasedatastore1 = new HBaseDataStore() {\n @Override\n public HTableInterface getConnection(String tableName) ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void deleteByTimestamp(String tableName, long timestamp) throws IOException {\n LOG.info(\"YuLing == entering deleteByTimestamp \");\n int batchSize = 500;\n List<Delete> deleteList = new ArrayList<>();\n Scan scan = new Scan();\n scan.setTimeRange(Long.MIN_VALUE, ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_109 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTimeStampFromTSDRKey() {\n long time = System.currentTimeMillis();\n String key = FormatUtil.getTSDRMetricKeyWithTimeStamp(createMetricRecord());\n long timeStamp = FormatUtil.getTimeStampFromTSDRKey(key);\n Assert.assertTrue(timeStamp >= time && ti... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static Long getTimeStampFromTSDRKey(String tsdrKey) {\n int index1 = tsdrKey.indexOf(KEY_TIMESTAMP);\n if (index1 == -1) {\n return null;\n }\n int index2 = findSubkeyClosingBracket(tsdrKey, index1);\n if (index2 == -1) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_9 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testCreateTable() throws Exception {\n hbaseDataStore.createTable(null);\n hbaseDataStore.createTable(\"tableName\");\n }",
"class_method_signature": "HBaseDataStoreTest.testCreateTable()",
"constructor": false,
"full_signature": "@Test public void testCreateTa... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void createTable(String tableName) throws IOException {\n LOG.debug(\"Entering createTable(tableName)\");\n if (tableName == null) {\n return;\n }\n\n ClassLoader ocl = Thread.currentThread().getContextClassLoader();\n Thread.currentThread().setContextCl... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_59 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testMetricStoreList() {\n List<TSDRMetricRecord> list = new ArrayList<>(2);\n TSDRMetricRecord metricRecord = CassandraStoreTest.createMetricRecord();\n list.add(metricRecord);\n impl.storeMetric(list);\n Mockito.verify(store, Mockito.atLeast(1)).st... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void storeMetric(TSDRMetricRecord metricRecord) {\n store.startBatch();\n store.store(metricRecord);\n store.executeBatch();\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImpl.storeMetric(TSDRMetricRecord metricRecord)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_22 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testGetDataByRowFamilyQualifierException() {\n HBaseDataStore hbasedatastore1 = null;\n hbasedatastore1 = new HBaseDataStore() {\n @Override\n public HTableInterface getConnection(String tableName) throws IOException {\n throw new IO... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,\n String family, String qualifier) {\n return getDataByRowFamilyQualifier(tableName, startRow, endRow, family, qualifier, 0);\n }",
"class_method_signature": "HBaseDataStore.getData... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_75 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test(expected = NullPointerException.class)\n public void storeNull() throws Exception {\n store.store(null);\n }",
"class_method_signature": "ElasticSearchStoreTest.storeNull()",
"constructor": false,
"full_signature": "@Test(expected = NullPointerException.class) public void storeNull... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void store(TSDRRecord record) {\n checkNotNull(record);\n checkState(isRunning(), \"The service is not running\");\n\n batchLock.lock();\n try {\n if (batch.remainingCapacity() == 0) {\n sync();\n }\n batch.add(record);\n } ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_63 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testGetTSDRMetricRecords() {\n impl.getTSDRMetricRecords(\"Test\", 0L, 0L);\n Mockito.verify(store, Mockito.atLeastOnce()).getTSDRMetricRecords(\"Test\", 0L, 0L, 1000);\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImplTest.testGetTSDRMetricRecord... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public List<TSDRMetricRecord> getTSDRMetricRecords(String tsdrMetricKey, long startDateTime, long endDateTime) {\n return store.getTSDRMetricRecords(tsdrMetricKey, startDateTime, endDateTime,\n TSDRConstants.MAX_RESULTS_FROM_LIST_METRICS_COMMAND);\n }",
"class_meth... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_34 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/v9/NetflowV9PacketParserTest.java",
"identifier": "NetflowV9PacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testMissingFlowsetTemplate() throws IOException {\n\n // First packet - data flow set with missing template\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeSho... | {
"fields": [
{
"declarator": "FLOW_SET_LOG_TEXT = \"Data FlowSet\"",
"modifier": "static final",
"original_string": "static final String FLOW_SET_LOG_TEXT = \"Data FlowSet\";",
"type": "String",
"var_name": "FLOW_SET_LOG_TEXT"
},
{
"declarator": "LOG = LoggerFactory.ge... | {
"body": "@Override\n public void parseRecords() {\n while (recordCounter < totalRecordCount && !endOfData()) {\n final OptionalInt possibleCount = parseNextRecords();\n if (!possibleCount.isPresent()) {\n return;\n }\n\n recordCounter += possibleC... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_35 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/v9/NetflowV9PacketParserTest.java",
"identifier": "NetflowV9PacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testMissingOptionsTemplate() throws IOException {\n // First packet - options data record with missing template\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writ... | {
"fields": [
{
"declarator": "FLOW_SET_LOG_TEXT = \"Data FlowSet\"",
"modifier": "static final",
"original_string": "static final String FLOW_SET_LOG_TEXT = \"Data FlowSet\";",
"type": "String",
"var_name": "FLOW_SET_LOG_TEXT"
},
{
"declarator": "LOG = LoggerFactory.ge... | {
"body": "@Override\n public void parseRecords() {\n while (recordCounter < totalRecordCount && !endOfData()) {\n final OptionalInt possibleCount = parseNextRecords();\n if (!possibleCount.isPresent()) {\n return;\n }\n\n recordCounter += possibleC... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_62 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testPurgeAllTSDRRecords() {\n impl.purge(0L);\n for (DataCategory dc : DataCategory.values()) {\n Mockito.verify(store, Mockito.atLeast(1)).purge(dc, 0L);\n }\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImplTest.testPurgeAllTSD... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void purge(DataCategory category, long retentionTime) {\n LOG.info(\"Execute Purge with Category {} and earlier than {}.\",category.name(),new Date(retentionTime));\n store.purge(category,retentionTime);\n }",
"class_method_signature": "TSDRCassandraPersistenceServi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_74 | {
"fields": [
{
"declarator": "store = Mockito.mock(ElasticSearchStore.class)",
"modifier": "private final",
"original_string": "private final ElasticSearchStore store = Mockito.mock(ElasticSearchStore.class);",
"type": "ElasticSearchStore",
"var_name": "store"
},
{
"de... | {
"body": "@Test\n public void purgeAll() throws Exception {\n long until = 0L;\n service.purge(until);\n for (DataCategory category : DataCategory.values()) {\n Mockito.verify(store, Mockito.atLeastOnce()).delete(category, until);\n }\n }",
"class_method_signature": "Ts... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n public void purge(long timestamp) {\n // TODO: rewrite this to a more effective version, by using one bulk delete instead of several separate calls.\n for (DataCategory category : DataCategory.values()) {\n purge(category, timestamp);\n }\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_23 | {
"fields": [
{
"declarator": "contextService = new HBaseDataStoreContext()",
"modifier": "private final",
"original_string": "private final HBaseDataStoreContext contextService = new HBaseDataStoreContext();",
"type": "HBaseDataStoreContext",
"var_name": "contextService"
}
],
... | {
"body": "@Test\n public void testGetZookeeperQuorum() {\n assertTrue(\"localhost\".equals(contextService.getZookeeperQuorum()));\n }",
"class_method_signature": "HBaseDataStoreContextTest.testGetZookeeperQuorum()",
"constructor": false,
"full_signature": "@Test public void testGetZookeeperQuorum(... | {
"fields": [
{
"declarator": "ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\"",
"modifier": "static final",
"original_string": "static final String ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\";",
"type": "String",
"var_name": "ZOO_KEEPER_QUORUM_PROP"
},
{
"declarator"... | {
"body": "public String getZookeeperQuorum() {\n return zookeeperQuorum;\n }",
"class_method_signature": "HBaseDataStoreContext.getZookeeperQuorum()",
"constructor": false,
"full_signature": "public String getZookeeperQuorum()",
"identifier": "getZookeeperQuorum",
"invocations": [],
"modifiers"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_58 | {
"fields": [
{
"declarator": "cluster = Mockito.mock(Cluster.class)",
"modifier": "private final",
"original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "session = Mockito.mock(Ses... | {
"body": "@Test\n public void testStoreLog() {\n TSDRLogRecord logRecord = CassandraStoreTest.createLogRecord();\n impl.storeLog(logRecord);\n Mockito.verify(store, Mockito.atLeast(1)).store(logRecord);\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImplTest.testStoreLog... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);",
"type": "Logger",
... | {
"body": "@Override\n public void storeLog(TSDRLogRecord logRecord) {\n store.startBatch();\n store.store(logRecord);\n store.executeBatch();\n }",
"class_method_signature": "TSDRCassandraPersistenceServiceImpl.storeLog(TSDRLogRecord logRecord)",
"constructor": false,
"full_signature... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_108 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsDataCategoryKey() {\n // test invalid tsdrMetricKey\n String key = \"[NID=][MN=][DC=][RK=]\";\n Assert.assertFalse(FormatUtil.isDataCategoryKey(key));\n key = \"[NID=][MN=]DC=[RK=]\";\n Assert.assertFalse(FormatUtil.isDataCategoryKey(key));\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static boolean isDataCategoryKey(String tsdrKey) {\n if (isValidTSDRKey(tsdrKey)) {\n /*\n * if it's a valid metircs key, getNodeId, getMetriName,\n * getRecordKeys, and getDataCategory from the tsdrkey would not be\n * null.\n */\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_8 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testGetConnection() throws IOException {\n hbaseDataStore.getConnection(\"tableName\");\n }",
"class_method_signature": "HBaseDataStoreTest.testGetConnection()",
"constructor": false,
"full_signature": "@Test public void testGetConnection()",
"identifier": "testGetC... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HTableInterface getConnection(String tableName) throws IOException {\n LOG.debug(\"Entering getConnection()\");\n HTableInterface htableResult = null;\n ClassLoader ocl = Thread.currentThread().getContextClassLoader();\n try {\n Thread.currentThread().setContex... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_19 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testGetDataByTimeRangeException() {\n HBaseDataStore hbasedatastore1 = null;\n hbasedatastore1 = new HBaseDataStore() {\n @Override\n public HTableInterface getConnection(String tableName) throws IOException {\n throw new IOException... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public List<HBaseEntity> getDataByTimeRange(String tableName, long startTime, long endTime) {\n return getDataByTimeRange(tableName, null, startTime, endTime);\n }",
"class_method_signature": "HBaseDataStore.getDataByTimeRange(String tableName, long startTime, long endTime)",
"constructor": f... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_39 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/ipfix/NetflowIPFIXPacketParserTest.java",
"identifier": "NetflowIPFIXPacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testOptions() throws IOException {\n // First packet - 2 options templates, 1 options data record\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(10); ... | {
"fields": [
{
"declarator": "DATA_RECORD_TEXT = \"Data Record\"",
"modifier": "static final",
"original_string": "static final String DATA_RECORD_TEXT = \"Data Record\";",
"type": "String",
"var_name": "DATA_RECORD_TEXT"
},
{
"declarator": "LOG = LoggerFactory.getLogg... | {
"body": "@Override\n public void parseRecords() {\n while (position() < totalPacketLength && !endOfData()) {\n if (!parseNextRecords()) {\n break;\n }\n }\n\n missingTemplateCache.checkTemplates();\n }",
"class_method_signature": "NetflowIPFIXPacketP... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_81 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void buildQueryStringOfBinary() throws Exception {\n String result = store.buildQueryString(ElasticSearchStore.RecordType.BINARY, \"FLOWSTATS\");\n assertThat(result.contains(TsdrRecordPayload.ELK_DATA_CATEGORY + \":\\\\\\\"FLOWSTATS\\\\\\\"\")).isTrue();\n\n result =... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "String buildQueryString(RecordType type, String tsdrKey) {\n StringBuffer queryBuffer = new StringBuffer();\n appendCondition(queryBuffer, TsdrRecordPayload.ELK_DATA_CATEGORY, resolveDataCategory(tsdrKey));\n\n try {\n Long timestamp = FormatUtil.getTimeStampFromTSDRKey(tsdr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_78 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test(expected = NullPointerException.class)\n public void storeAllRecordListHasNullRecord() throws Exception {\n store.storeAll(Collections.singletonList(null));\n }",
"class_method_signature": "ElasticSearchStoreTest.storeAllRecordListHasNullRecord()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void storeAll(List<? extends TSDRRecord> records) {\n checkNotNull(records);\n\n // check whether content of the list doesn't contain a null value.\n for (TSDRRecord record : records) {\n checkNotNull(record);\n }\n checkState(isRunning(), \"The service is not ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_97 | {
"fields": [
{
"declarator": "connection = Mockito.mock(Connection.class)",
"modifier": "private final",
"original_string": "private final Connection connection = Mockito.mock(Connection.class);",
"type": "Connection",
"var_name": "connection"
},
{
"declarator": "state... | {
"body": "@Test\n public void testLoadPathsCache() throws SQLException {\n store.store(createMetricRecord());\n }",
"class_method_signature": "HsqlDBStoreTest.testLoadPathsCache()",
"constructor": false,
"full_signature": "@Test public void testLoadPathsCache()",
"identifier": "testLoadPathsCach... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HsqlDBStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HsqlDBStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@SuppressFBWarnings(\"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE\")\n public void store(TSDRMetricRecord mr) throws SQLException {\n //create metric key\n String tsdrKey = FormatUtil.getTSDRMetricKey(mr);\n TSDRCacheEntry cacheEntry = cache.getCacheEntry(tsdrKey);\n\n //if it d... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_54 | {
"fields": [
{
"declarator": "configObject = new TSDRRestconfCollectorConfig()",
"modifier": "private final",
"original_string": "private final TSDRRestconfCollectorConfig configObject = new TSDRRestconfCollectorConfig();",
"type": "TSDRRestconfCollectorConfig",
"var_name": "configO... | {
"body": "@Test\n public void testInit() throws ConfigurationException {\n configObject.init();\n\n assertEquals(ImmutableSet.of(\"POST\", \"PUT\", \"DELETE\", \"PATCH\"), configObject.getMethodsToLog());\n assertTrue(configObject.getPathsToLog().matcher(\"foo\").matches());\n assertTr... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@PostConstruct\n public void init() throws ConfigurationException {\n parseProperties(null);\n }",
"class_method_signature": "TSDRRestconfCollectorConfig.init()",
"constructor": false,
"full_signature": "@PostConstruct public void init()",
"identifier": "init",
"invocations": [
"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_104 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTSDRLogKeyWithAttributes() {\n String key = FormatUtil.getTSDRLogKeyWithRecordAttributes(createLogRecord());\n Assert.assertEquals(\"[NID=Test][DC=EXTERNAL][RK=Test2:Test1][RA=RATest:RAValue]\", key);\n }",
"class_method_signature": "FormatUtilTest.testGetTS... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static String getTSDRLogKeyWithRecordAttributes(TSDRLog log) {\n StringBuilder sb = new StringBuilder(getTSDRLogKey(log));\n sb.append(KEY_RECORD_ATTRIBUTES);\n if (log.getRecordAttributes() != null) {\n boolean isFirst = true;\n for (RecordAttributes rec :... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_4 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testSetColumnQualifier() {\n hbaseColumn.setColumnQualifier(\"newColumnQualifier\");\n assertTrue(\"newColumnQualifier\".equals(hbaseColumn.getColumnQualifier()));\n }",
"class_method_signature": "HBaseColumnTest.testSetColumnQualifier()",
"constructor": false,
... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public void setColumnQualifier(String collumnQualifier) {\n this.columnQualifier = collumnQualifier;\n }",
"class_method_signature": "HBaseColumn.setColumnQualifier(String collumnQualifier)",
"constructor": false,
"full_signature": "public void setColumnQualifier(String collumnQualifier)",
... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_112 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/MD5IDTest.java",
"identifier": "MD5IDTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateByteMD5() {\n MD5ID id1 = MD5ID.createTSDRId(\"Hello World\".getBytes());\n MD5ID id2 = MD5ID.createTSDRId(\"Hello World\".getBytes());\n Assert.assertEquals(id1,id2);\n }",
"class_method_signature": "MD5IDTest.testCreateByteMD5()",
"constructor"... | {
"fields": [
{
"declarator": "MD",
"modifier": "private static final",
"original_string": "private static final MessageDigest MD;",
"type": "MessageDigest",
"var_name": "MD"
},
{
"declarator": "md5Long1",
"modifier": "private final",
"original_string": "pri... | {
"body": "public static MD5ID createTSDRId(final String tsdrKey) {\n return new MD5ID(tsdrKey.getBytes(StandardCharsets.UTF_8), false);\n }",
"class_method_signature": "MD5ID.createTSDRId(final String tsdrKey)",
"constructor": false,
"full_signature": "public static MD5ID createTSDRId(final String ts... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_15 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testCreateEntityList() throws TableNotFoundException {\n List<HBaseEntity> entityList = new ArrayList<>();\n hbaseDataStore.create(entityList);\n HBaseEntity dentity1 = new HBaseEntity();\n dentity1.setRowKey(\"rowKey1\");\n dentity1.setTableName(\"... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public HBaseEntity create(final HBaseEntity entity) throws TableNotFoundException {\n LOG.debug(\"Entering create(HBaseEntity entity)\");\n if (entity != null && entity.getRowKey() != null) {\n Put put = new Put(Bytes.toBytes(entity.getRowKey()));\n for (HBaseColumn curr... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_42 | {
"fields": [
{
"declarator": "FILE_NAME = \"./etc/tsdr-log-collector.properties\"",
"modifier": "private static final",
"original_string": "private static final String FILE_NAME = \"./etc/tsdr-log-collector.properties\";",
"type": "String",
"var_name": "FILE_NAME"
},
{
... | {
"body": "@Test\n public void testIgnoredLoggerCategories() {\n final TsdrLogCollector tsdrLogCollector =\n new TsdrLogCollector(tsdrLogCollectorLogger, new TsdrLogCollectorConfig(FILE_NAME));\n\n assertTrue(tsdrLogCollector.isIgnored(\"org.opendaylight.tsdr.test\"));\n assertF... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(TsdrLogCollector.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(TsdrLogCollector.class);",
"type": "Logger",
"var_name"... | {
"body": "@VisibleForTesting\n boolean isIgnored(String loggerName) {\n if (loggerName == null) {\n return true;\n }\n return logCollectorConfig.getIgnoredCategories()\n .stream().anyMatch(category -> category.matcher(loggerName).matches());\n }",
"class_method_... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_49 | {
"fields": [
{
"declarator": "NOTIFICATION_SCHEMA_PATH =\n SchemaPath.create(true, OutOfPixieDustNotification.QNAME)",
"modifier": "private static final",
"original_string": "private static final SchemaPath NOTIFICATION_SCHEMA_PATH =\n SchemaPath.create(true, OutOfPixieDus... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testClose() {\n DOMNotificationRouter spiedNotificationRouter = spy(domNotificationRouter);\n ListenerRegistration<?> mocklListenerReg = mock(ListenerRegistration.class);\n doReturn(mocklListenerReg).when(spiedNotificationRou... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(YangNotificationCollectorLogger.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(YangNotificationCollectorLogger.class);",
"type": "Logger",
"var_nam... | {
"body": "@Override\n public void close() {\n LOG.debug(\"Closing...\");\n super.close();\n\n if (notificationReg != null) {\n notificationReg.close();\n }\n }",
"class_method_signature": "YangNotificationCollectorLogger.close()",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_24 | {
"fields": [
{
"declarator": "contextService = new HBaseDataStoreContext()",
"modifier": "private final",
"original_string": "private final HBaseDataStoreContext contextService = new HBaseDataStoreContext();",
"type": "HBaseDataStoreContext",
"var_name": "contextService"
}
],
... | {
"body": "@Test\n public void testGetZookeeperClientport() {\n assertTrue(\"2181\".equals(contextService.getZookeeperClientport()));\n }",
"class_method_signature": "HBaseDataStoreContextTest.testGetZookeeperClientport()",
"constructor": false,
"full_signature": "@Test public void testGetZookeeper... | {
"fields": [
{
"declarator": "ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\"",
"modifier": "static final",
"original_string": "static final String ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\";",
"type": "String",
"var_name": "ZOO_KEEPER_QUORUM_PROP"
},
{
"declarator"... | {
"body": "public String getZookeeperClientport() {\n return zookeeperClientport;\n }",
"class_method_signature": "HBaseDataStoreContext.getZookeeperClientport()",
"constructor": false,
"full_signature": "public String getZookeeperClientport()",
"identifier": "getZookeeperClientport",
"invocations... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_73 | {
"fields": [
{
"declarator": "store = Mockito.mock(ElasticSearchStore.class)",
"modifier": "private final",
"original_string": "private final ElasticSearchStore store = Mockito.mock(ElasticSearchStore.class);",
"type": "ElasticSearchStore",
"var_name": "store"
},
{
"de... | {
"body": "@Test\n public void purge() throws Exception {\n long until = 0L;\n DataCategory category = DataCategory.QUEUESTATS;\n service.purge(category, until);\n Mockito.verify(store, Mockito.only()).delete(category, until);\n Mockito.doThrow(IllegalStateException.class).when(s... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n public void purge(long timestamp) {\n // TODO: rewrite this to a more effective version, by using one bulk delete instead of several separate calls.\n for (DataCategory category : DataCategory.values()) {\n purge(category, timestamp);\n }\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_65 | {
"fields": [
{
"declarator": "tsdrJpaService = null",
"modifier": "",
"original_string": "TsdrJpaServiceImpl tsdrJpaService = null;",
"type": "TsdrJpaServiceImpl",
"var_name": "tsdrJpaService"
},
{
"declarator": "tsdrH2PersistenceService = null",
"modifier": "",
... | {
"body": "@Test\n public void testStore() throws Exception {\n em.getTransaction().begin();\n\n RecordKeys recordKeys = new RecordKeysBuilder()\n .setKeyName(\"recordKeyName\")\n .setKeyValue(\"node_table_flow\").build();\n\n List<RecordKeys> recordKeysList= new ArrayLis... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TsdrH2PersistenceServiceImpl.class)",
"modifier": "private final static",
"original_string": "private final static Logger log = LoggerFactory.getLogger(TsdrH2PersistenceServiceImpl.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@Override\n public void store(TSDRMetricRecord metrics){\n Preconditions.checkArgument(metrics != null);\n DataCategory dc =metrics.getTSDRDataCategory();\n Preconditions.checkArgument(dc != null);\n if(jpaService != null) {\n Metric metric = getEntityFromModel(met... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_32 | {
"fields": [],
"file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/v9/NetflowV9PacketParserTest.java",
"identifier": "NetflowV9PacketParserTest",
"interfaces": "",
"superclass": "extends NetflowPacketParserTestBase"
} | {
"body": "@Test\n public void testDataFlowsets() throws IOException {\n // First packet - 2 templates, 2 data flowset records\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); ... | {
"fields": [
{
"declarator": "FLOW_SET_LOG_TEXT = \"Data FlowSet\"",
"modifier": "static final",
"original_string": "static final String FLOW_SET_LOG_TEXT = \"Data FlowSet\";",
"type": "String",
"var_name": "FLOW_SET_LOG_TEXT"
},
{
"declarator": "LOG = LoggerFactory.ge... | {
"body": "@Override\n public void parseRecords() {\n while (recordCounter < totalRecordCount && !endOfData()) {\n final OptionalInt possibleCount = parseNextRecords();\n if (!possibleCount.isPresent()) {\n return;\n }\n\n recordCounter += possibleC... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_45 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testInsertTSDRMetricRecordFailure() throws InterruptedException, ExecutionException, TimeoutException {\n String failureMessage = \"Failed to store record\";\n doReturn(RpcResultBuilder.failed().withError(ErrorType.APPLICATION, failureMessage).buildFuture())\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(CollectorSPIImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(CollectorSPIImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Override\n public ListenableFuture<RpcResult<InsertTSDRMetricRecordOutput>> insertTSDRMetricRecord(\n InsertTSDRMetricRecordInput input) {\n List<TSDRMetricRecord> records = input.getTSDRMetricRecord().stream().map(inputRec ->\n new TSDRMetricRecordBuilder().setMetricName(i... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_12 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testGetDataByRowFamilyQualifier() throws Exception {\n Assert.isNotNull(\n hbaseDataStore.getDataByRowFamilyQualifier(\"tableName\", \"startRow\", \"endRow\", \"family\", \"qualifier\"));\n Assert.isNotNull(\n hbaseDataStore.getDataByRowFam... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,\n String family, String qualifier) {\n return getDataByRowFamilyQualifier(tableName, startRow, endRow, family, qualifier, 0);\n }",
"class_method_signature": "HBaseDataStore.getData... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_103 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTSDRLogKey() {\n String key = FormatUtil.getTSDRLogKey(createLogRecord());\n Assert.assertEquals(\"[NID=Test][DC=EXTERNAL][RK=Test2:Test1]\", key);\n }",
"class_method_signature": "FormatUtilTest.testGetTSDRLogKey()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static String getTSDRLogKey(TSDRLog log) {\n StringBuilder sb = new StringBuilder();\n sb.append(KEY_NODEID);\n if (log.getNodeID() != null) {\n sb.append(log.getNodeID());\n }\n sb.append(\"]\");\n sb.append(KEY_CATEGORY);\n if (log.getTSD... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_3 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testSetColumnFamily() {\n hbaseColumn.setColumnFamily(\"newColumnFamily\");\n assertTrue(\"newColumnFamily\".equals(hbaseColumn.getColumnFamily()));\n }",
"class_method_signature": "HBaseColumnTest.testSetColumnFamily()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public void setColumnFamily(String collumnFamily) {\n this.columnFamily = collumnFamily;\n }",
"class_method_signature": "HBaseColumn.setColumnFamily(String collumnFamily)",
"constructor": false,
"full_signature": "public void setColumnFamily(String collumnFamily)",
"identifier": "setColu... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_53 | {
"fields": [
{
"declarator": "configObject = new TSDRRestconfCollectorConfig()",
"modifier": "private final",
"original_string": "private final TSDRRestconfCollectorConfig configObject = new TSDRRestconfCollectorConfig();",
"type": "TSDRRestconfCollectorConfig",
"var_name": "configO... | {
"body": "@Test(expected = ConfigurationException.class)\n public void testInvalidContentRegex() throws ConfigurationException {\n Dictionary<String, String> properties = new Hashtable<>();\n\n properties.put(CONTENT_TO_LOG, \"(\");\n\n configObject.updated(properties);\n }",
"class_meth... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n @SuppressFBWarnings(\"RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT\")\n @Override\n public synchronized void updated(Dictionary properties) throws ConfigurationException {\n parseProperties(properties);\n\n LOG.info(\"TSDRRestconfCollect... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_28 | {
"fields": [],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBasePersistenceUtilTest.java",
"identifier": "HBasePersistenceUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetEntityFromMetricStats() {\n String timeStamp = new Long(new Date().getTime()).toString();\n List<RecordKeys> recordKeys = new ArrayList<>();\n RecordKeys recordKey = new RecordKeysBuilder()\n .setKeyName(TSDRConstants.FLOW_TABLE_KEY_NAME)\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBasePersistenceUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBasePersistenceUtil.class);",
"type": "Logger",
"var_name": "LOG"
}
],
... | {
"body": "public static HBaseEntity getEntityFromMetricStats(TSDRMetric metricData, DataCategory dataCategory) {\n LOG.debug(\"Entering getEntityFromMetricStats(TSDRMetric)\");\n if (!validateMetricInput(metricData)) {\n return null;\n }\n\n HBaseEntity entity = new HBaseEntity... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_90 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testStoreMetricList() throws SQLException {\n List<TSDRMetricRecord> list = new ArrayList<>(1);\n TSDRMetricRecord metricRecord = HsqlDBStoreTest.createMetricRecord();\n list.add(metricRecord);\n impl.storeMetric(list);\n Mockito.verify(store, Mocki... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void storeMetric(TSDRMetricRecord metricRecord) {\n try {\n store.store(metricRecord);\n } catch (SQLException e) {\n LOG.error(\"Failed to store record to database\", e);\n }\n }",
"class_method_signature": "TsdrHsqlDBPersistenceService... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_69 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testAddLogsWithoutServiceInInput() {\n AddLogInputBuilder input = new AddLogInputBuilder();\n input.setRecordFullText(\"Test\");\n input.setNodeID(\"Test\");\n input.setTimeStamp(System.currentTimeMillis());\n input.setTSDRDataCategory(DataCategory.... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) {\n TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder();\n builder.setRecordFullText(input.getRecordFullText());\n builder.setNodeID(input.getNodeID());\n builder.setTimeStamp(input.g... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_86 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void scheduler() throws Exception {\n assertThat(store.scheduler()).isNotNull();\n }",
"class_method_signature": "ElasticSearchStoreTest.scheduler()",
"constructor": false,
"full_signature": "@Test public void scheduler()",
"identifier": "scheduler",
"invocations": [
... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n protected Scheduler scheduler() {\n long delay = 1L;\n if (properties.containsKey(\"syncInterval\")) {\n delay = Math.max(Long.parseLong(properties.get(\"syncInterval\")), delay);\n }\n return Scheduler.newFixedDelaySchedule(0L, delay, TimeUnit.SECONDS)... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_68 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testAddLogsWithServiceInInput() {\n AddLogInputBuilder input = new AddLogInputBuilder();\n input.setRecordFullText(\"Test\");\n input.setNodeID(\"Test\");\n input.setTimeStamp(System.currentTimeMillis());\n input.setTSDRDataCategory(DataCategory.EXT... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) {\n TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder();\n builder.setRecordFullText(input.getRecordFullText());\n builder.setNodeID(input.getNodeID());\n builder.setTimeStamp(input.g... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_87 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n public void startup() throws Exception {\n ElasticSearchStore localStore = new ElasticSearchStore(PROPERTIES, null) {\n @Override\n JestClient createJestClient() throws IOException {\n return CLIENT;\n }\n\n };\n localStore.sta... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n protected void startUp() throws Exception {\n if (client != null) {\n return;\n }\n\n client = createJestClient();\n IndicesExists action = new IndicesExists.Builder(INDEX).build();\n while (state() == State.STARTING) {\n JestResult re... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_91 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testStoreLogList() throws SQLException {\n List<TSDRLogRecord> list = new ArrayList<>(1);\n TSDRLogRecord metricRecord = HsqlDBStoreTest.createLogRecord();\n list.add(metricRecord);\n impl.storeLog(list);\n Mockito.verify(store, Mockito.atLeast(1)).... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void storeLog(TSDRLogRecord logRecord) {\n try {\n store.store(logRecord);\n } catch (SQLException e) {\n LOG.error(\"Failed to store record to database\", e);\n }\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImpl.storeLo... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_29 | {
"fields": [],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBasePersistenceUtilTest.java",
"identifier": "HBasePersistenceUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetEntityFromLogRecord() {\n final String timeStamp = new Long(new Date().getTime()).toString();\n List<RecordKeys> recordKeys = new ArrayList<>();\n RecordKeys recordKey1 = new RecordKeysBuilder()\n .setKeyName(DataCategory.SYSLOG.name())\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBasePersistenceUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBasePersistenceUtil.class);",
"type": "Logger",
"var_name": "LOG"
}
],
... | {
"body": "public static HBaseEntity getEntityFromLogRecord(TSDRLogRecord logRecord, DataCategory dataCategory) {\n LOG.debug(\"Entering getEntityFromLogRecord(TSDRLogRecord)\");\n if (!validateLogRecordInput(logRecord)) {\n return null;\n }\n HBaseEntity entity = new HBaseEntit... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_52 | {
"fields": [
{
"declarator": "configObject = new TSDRRestconfCollectorConfig()",
"modifier": "private final",
"original_string": "private final TSDRRestconfCollectorConfig configObject = new TSDRRestconfCollectorConfig();",
"type": "TSDRRestconfCollectorConfig",
"var_name": "configO... | {
"body": "@Test(expected = ConfigurationException.class)\n public void testInvalidRemoteAddressesRegex() throws ConfigurationException {\n Dictionary<String, String> properties = new Hashtable<>();\n\n properties.put(ADDRESSES_TO_LOG, \"(\");\n\n configObject.updated(properties);\n }",
"... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n @SuppressFBWarnings(\"RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT\")\n @Override\n public synchronized void updated(Dictionary properties) throws ConfigurationException {\n parseProperties(properties);\n\n LOG.info(\"TSDRRestconfCollect... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_102 | {
"fields": [],
"file": "persistence-spi/src/test/java/org/opendaylight/tsdr/spi/util/FormatUtilTest.java",
"identifier": "FormatUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTSDRMetricKey() {\n String key = FormatUtil.getTSDRMetricKey(createMetricRecord());\n Assert.assertEquals(\"[NID=Test][DC=EXTERNAL][MN=Test][RK=Test2:Test1]\", key);\n }",
"class_method_signature": "FormatUtilTest.testGetTSDRMetricKey()",
"constructor": fa... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FormatUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FormatUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static String getTSDRMetricKey(TSDRMetric metric) {\n StringBuilder sb = new StringBuilder();\n sb.append(KEY_NODEID);\n if (metric.getNodeID() != null) {\n sb.append(metric.getNodeID());\n }\n sb.append(\"]\");\n sb.append(KEY_CATEGORY);\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_2 | {
"fields": [
{
"declarator": "hbaseColumn",
"modifier": "private",
"original_string": "private HBaseColumn hbaseColumn;",
"type": "HBaseColumn",
"var_name": "hbaseColumn"
}
],
"file": "persistence-hbase/src/test/java/org/opendaylight/tsdr/persistence/hbase/HBaseColumnTest.ja... | {
"body": "@Test\n public void testGetValue() {\n assertTrue(\"value\".equals(hbaseColumn.getValue()));\n }",
"class_method_signature": "HBaseColumnTest.testGetValue()",
"constructor": false,
"full_signature": "@Test public void testGetValue()",
"identifier": "testGetValue",
"invocations": [
... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "columnFamily",
"modifier": "private... | {
"body": "public String getValue() {\n return value;\n }",
"class_method_signature": "HBaseColumn.getValue()",
"constructor": false,
"full_signature": "public String getValue()",
"identifier": "getValue",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"s... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_13 | {
"fields": [
{
"declarator": "hbaseDataStore",
"modifier": "private",
"original_string": "private HBaseDataStore hbaseDataStore;",
"type": "HBaseDataStore",
"var_name": "hbaseDataStore"
},
{
"declarator": "hbaseDataStoreContext",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testGetDataByTimeRange() throws Exception {\n hbaseDataStore.getDataByTimeRange(\"tableName\", 0L, 100);\n hbaseDataStore.getDataByTimeRange(\"tableName\", 100, 200);\n List<String> filters = new ArrayList<>();\n filters.add(\"filter1\");\n filters.... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HBaseDataStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HBaseDataStore.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public List<HBaseEntity> getDataByTimeRange(String tableName, long startTime, long endTime) {\n return getDataByTimeRange(tableName, null, startTime, endTime);\n }",
"class_method_signature": "HBaseDataStore.getDataByTimeRange(String tableName, long startTime, long endTime)",
"constructor": f... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.