id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
36960637_69 | {
"fields": [
{
"declarator": "CLIENT = Client.of(\"client\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT = Client.of(\"client\");",
"type": "Client",
"var_name": "CLIENT"
},
{
"declarator": "CLIENT_2 = Client.of(\"client... | {
"body": "@Test\n public void failureMechanismNotInvokedIfNoNodeIsTheLeader() {\n when(checker1.getFreshTimestampFromNodeForClient(CLIENT.value())).thenReturn(OptionalLong.empty());\n when(checker2.getFreshTimestampFromNodeForClient(CLIENT.value())).thenReturn(OptionalLong.empty());\n\n noSim... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(NoSimultaneousServiceCheck.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(NoSimultaneousServiceCheck.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "public void processHealthCheckDigest(HealthCheckDigest digest) {\n Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS);\n if (clientsWithMultipleLeaders.isEmpty()) {\n return;\n }\n\n log.info(\"Clients {} appear to ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_449 | {
"fields": [
{
"declarator": "kvs = new InMemoryKeyValueService(true)",
"modifier": "private final",
"original_string": "private final KeyValueService kvs = new InMemoryKeyValueService(true);",
"type": "KeyValueService",
"var_name": "kvs"
},
{
"declarator": "idsToNames... | {
"body": "@Test\n public void testConcurrentCreationOfMultipleTables() {\n namesToIds.storeAsPending(table(1), 1);\n idsToNames.storeNewMapping(table(2), 1);\n assertThat(tableIndices.getTableId(table(1))).isEqualTo(2);\n }",
"class_method_signature": "SweepTableIndicesTest.testConcurren... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SweepTableIndices.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SweepTableIndices.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "public int getTableId(TableReference table) {\n return tableIndices.get(table);\n }",
"class_method_signature": "SweepTableIndices.getTableId(TableReference table)",
"constructor": false,
"full_signature": "public int getTableId(TableReference table)",
"identifier": "getTableId",
"invoc... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_86 | {
"fields": [
{
"declarator": "CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\")",
"modifier": "private static final",
"original_string": "private static final List<String> CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\");",
"type": "List<String>",
"var... | {
"body": "@Test\n public void canGetSslConfiguration() {\n assertThat(PaxosRemotingUtils.getSslConfigurationOptional(SSL_TIMELOCK))\n .isEqualTo(Optional.of(SSL_CONFIGURATION));\n assertThat(PaxosRemotingUtils.getSslConfigurationOptional(NO_SSL_TIMELOCK)).isEqualTo(Optional.empty());\... | {
"fields": [],
"file": "timelock-agent/src/main/java/com/palantir/timelock/paxos/PaxosRemotingUtils.java",
"identifier": "PaxosRemotingUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PaxosRemotingUtils.PaxosRemotingUtils()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static Optional<SslConfiguration> getSslConfigurationOptional(TimeLockInstallConfiguration install) {\n return getClusterConfiguration(install).cluster().security();\n }",
"class_method_signature": "PaxosRemotingUtils.getSslConfigurationOptional(TimeLockInstallConfiguration install)",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_330 | {
"fields": [
{
"declarator": "TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\");",
"type"... | {
"body": "@Test\n public void rowComponentsExplicitlyMarkedSafeAreSafe() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .putPermittedRowComponents(TABLE_REFERENCE_1, ImmutableSet.of(ROW_COMPONENT_1))\n .build();\n\n assertThat(safeLoggable... | {
"fields": [],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/logging/SafeLoggableData.java",
"identifier": "SafeLoggableData",
"interfaces": "implements KeyValueServiceLogArbitrator",
"methods": [
{
"class_method_signature": "SafeLoggableData.permittedTableReferences()",
"constru... | {
"body": "@Override\n public boolean isRowComponentNameSafe(TableReference tableReference, String rowComponentName) {\n return permittedRowComponents().containsKey(tableReference)\n && permittedRowComponents().get(tableReference).contains(rowComponentName);\n }",
"class_method_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_760 | {
"fields": [
{
"declarator": "DENSELY_ACCESSED_WIDE_ROWS_METADATA\n = TableMetadata.internal().denselyAccessedWideRows(true).build()",
"modifier": "private static final",
"original_string": "private static final TableMetadata DENSELY_ACCESSED_WIDE_ROWS_METADATA\n = TableMe... | {
"body": "@Test\n public void tablesWithAppendHeavyReadLightHaveSizeTieredBasedBloomFilterFpChance() {\n assertThat(CassandraTableOptions.bloomFilterFpChance(APPEND_HEAVY_READ_LIGHT_METADATA))\n .isEqualTo(CassandraConstants.DEFAULT_SIZE_TIERED_COMPACTION_BLOOM_FILTER_FP_CHANCE);\n as... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraTableOptions.java",
"identifier": "CassandraTableOptions",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraTableOptions.CassandraTableOptions()",
"constructor": true,
... | {
"body": "static double bloomFilterFpChance(TableMetadata tableMetadata) {\n if (tableMetadata.hasDenselyAccessedWideRows()) {\n return CassandraConstants.DENSELY_ACCESSED_WIDE_ROWS_BLOOM_FILTER_FP_CHANCE;\n }\n if (tableMetadata.isAppendHeavyAndReadLight()) {\n return tabl... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_275 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "TABL... | {
"body": "@Test\n public void delegatesInitializationCheck() {\n when(delegate.isInitialized())\n .thenReturn(false)\n .thenReturn(true);\n\n assertFalse(kvs.isInitialized());\n assertTrue(kvs.isInitialized());\n }",
"class_method_signature": "ProfilingKeyVa... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final KeyValueService delegate;",
"type": "KeyValueService",
"var_name": "delegate"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/ProfilingKeyVal... | {
"body": "@Override\n public boolean isInitialized() {\n return maybeLog(delegate::isInitialized,\n logTime(\"isInitialized\"));\n }",
"class_method_signature": "ProfilingKeyValueService.isInitialized()",
"constructor": false,
"full_signature": "@Override public boolean isInitialize... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_625 | {
"fields": [
{
"declarator": "SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.getCanonicalName() + \".setupTask\"",
"modifier": "private static final",
"original_string": "private static final String SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.g... | {
"body": "@Test\n public void startEmptyBatchOfTransactionsDoesNotCallTimelockService() {\n TimelockService timelockService =\n spy(new LegacyTimelockService(timestampService, closeableLockService, LockClient.of(\"lock\")));\n SnapshotTransactionManager transactionManager = createSnap... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SnapshotTransactionManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SnapshotTransactionManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public List<OpenTransaction> startTransactions(List<? extends PreCommitCondition> conditions) {\n if (conditions.isEmpty()) {\n return ImmutableList.of();\n }\n\n List<StartIdentifiedAtlasDbTransactionResponse> responses =\n timelockService.star... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_808 | {
"fields": [
{
"declarator": "BYTES1 = ByteBuffer.allocate(3)",
"modifier": "private static final",
"original_string": "private static final ByteBuffer BYTES1 = ByteBuffer.allocate(3);",
"type": "ByteBuffer",
"var_name": "BYTES1"
},
{
"declarator": "BYTES2 = ByteBuffer... | {
"body": "@Test\n public void batchMutateWeigherReturnsSameAsSuccessForFailure() {\n Map<ByteBuffer, Map<String, List<Mutation>>> mutations = ImmutableMap.of(\n BYTES1, ImmutableMap.of(\"foo\", ImmutableList.of(MUTATION, MUTATION)));\n\n QueryWeigher<Void> weigher = ThriftQueryWeigher... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraClient.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "public static QueryWeigher<Void> batchMutate(Map<ByteBuffer, Map<String, List<Mutation>>> mutationMap) {\n long numRows = mutationMap.size();\n return writeWeigher(numRows, () -> ThriftObjectSizeUtils.getApproximateSizeOfMutationMap(mutationMap));\n }",
"class_method_signature": "ThriftQ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_737 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraApiVersionTest.java",
"identifier": "CassandraApiVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void\n version_20_40_1_supports_cas() {\n CassandraApiVersion version = new CassandraApiVersion(\"20.40.1\");\n assertThat(version.supportsCheckAndSet(), is(true));\n }",
"class_method_signature": "CassandraApiVersionTest.version_20_40_1_supports_cas()",
"constructor": ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public boolean supportsCheckAndSet() {\n boolean supportsCheckAndSet = majorVersion > 19 || (majorVersion == 19 && minorVersion >= 37);\n\n if (supportsCheckAndSet) {\n LOGGER.info(\"Your cassandra api version ({}) supports check and set.\",\n SafeArg.of(\"cassan... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_367 | {
"fields": [
{
"declarator": "SUITE_NAME = \"PerformanceResults\"",
"modifier": "private static final",
"original_string": "private static final String SUITE_NAME = \"PerformanceResults\";",
"type": "String",
"var_name": "SUITE_NAME"
},
{
"declarator": "BENCHMARK_NAME ... | {
"body": "@Test\n public void doesNotDownsampleSampleMaxsizeSample() {\n MultisetStatistics stats = new MultisetStatistics();\n for (double number : SMALL_SAMPLE) {\n stats.addValue(number, 1);\n }\n Mockito.when(mockResult.getStatistics()).thenReturn(stats);\n assert... | {
"fields": [
{
"declarator": "KVS_AGNOSTIC_SUFFIX = \"N/A\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String KVS_AGNOSTIC_SUFFIX = \"N/A\";",
"type": "String",
"var_name": "KVS_AGNOSTIC_SUFFIX"
},
{
"... | {
"body": "@VisibleForTesting\n static List<Double> getData(RunResult result) {\n return getRawResults(result.getPrimaryResult().getStatistics());\n }",
"class_method_signature": "PerformanceResults.getData(RunResult result)",
"constructor": false,
"full_signature": "@VisibleForTesting static List<... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_388 | {
"fields": [
{
"declarator": "FQ_TABLE = TableReference.createFromFullyQualifiedName(\"test.test\")",
"modifier": "private static final",
"original_string": "private static final TableReference FQ_TABLE = TableReference.createFromFullyQualifiedName(\"test.test\");",
"type": "TableReferenc... | {
"body": "@Test\n public void getMappedTableNameThrowsOnNonExistingTableName() throws TableMappingNotFoundException {\n assertThatThrownBy(() -> tableMapping.getMappedTableName(FQ_TABLE2))\n .as(\"Table that was never added\")\n .isInstanceOf(TableMappingNotFoundException.clas... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KvTableMappingService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KvTableMappingService.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public TableReference getMappedTableName(TableReference tableRef) throws TableMappingNotFoundException {\n if (tableRef.getNamespace().isEmptyNamespace()) {\n return tableRef;\n }\n\n TableReference shortTableName = getMappedTableRef(tableRef);\n valida... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_672 | {
"fields": [
{
"declarator": "STRING_SUPPLIER = mock(Supplier.class)",
"modifier": "private final",
"original_string": "private final Supplier<String> STRING_SUPPLIER = mock(Supplier.class);",
"type": "Supplier<String>",
"var_name": "STRING_SUPPLIER"
},
{
"declarator":... | {
"body": "@Test\n public void getsFreshValuesFromSupplier() {\n when(STRING_SUPPLIER.get())\n .thenReturn(\"42\")\n .thenReturn(\"4242\");\n assertThat(TRANSFORMING_SUPPLIER.get()).isEqualTo(42);\n assertThat(TRANSFORMING_SUPPLIER.get()).isEqualTo(4242);\n }",... | {
"fields": [
{
"declarator": "inputSupplier",
"modifier": "private final",
"original_string": "private final Supplier<T> inputSupplier;",
"type": "Supplier<T>",
"var_name": "inputSupplier"
},
{
"declarator": "outputFunction",
"modifier": "private final",
"o... | {
"body": "@Override\n public synchronized U get() {\n T currentInput = inputSupplier.get();\n\n if (Objects.equals(cachedInput, currentInput)) {\n return cachedOutput;\n }\n\n cachedInput = currentInput;\n cachedOutput = outputFunction.apply(cachedInput);\n ret... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_222 | {
"fields": [
{
"declarator": "CUSTOM_METRIC_NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String CUSTOM_METRIC_NAME = \"foo\";",
"type": "String",
"var_name": "CUSTOM_METRIC_NAME"
},
{
"declarator": "PING_METHOD = \"ping\... | {
"body": "@Test\n public void instrumentWithDefaultNameTimedDoesNotWorkWithDelegates() {\n TestService service = AtlasDbMetrics.instrumentTimed(metrics, TestService.class, testServiceDelegate);\n\n assertMethodNotInstrumented(PING_REQUEST_METRIC, service::ping);\n assertMethodNotInstrumented(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AtlasDbMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AtlasDbMetrics.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "at... | {
"body": "public static <T, U extends T> T instrumentTimed(\n MetricRegistry metricRegistry, Class<T> serviceInterface, U service) {\n return instrument(metricRegistry, serviceInterface, service, serviceInterface.getName(), instrumentTimedOnly());\n }",
"class_method_signature": "AtlasDbMetric... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_28 | {
"fields": [
{
"declarator": "TABLE = TableReference.createFromFullyQualifiedName(\"test.table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE = TableReference.createFromFullyQualifiedName(\"test.table\");",
"type": "TableReference",
... | {
"body": "@Test\n public void rowStartingWithZeroIsIgnoredForCells() {\n LockDescriptor descriptor = AtlasCellLockDescriptor.of(TABLE.getQualifiedName(), START_WITH_ZERO, NO_ZERO_COL);\n assertThat(AtlasLockDescriptorUtils.candidateCells(descriptor))\n .containsExactly(CellReference.o... | {
"fields": [],
"file": "atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/AtlasLockDescriptorUtils.java",
"identifier": "AtlasLockDescriptorUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "AtlasLockDescriptorUtils.AtlasLockDescriptorUtils()",
"constructor": true,
... | {
"body": "public static List<CellReference> candidateCells(LockDescriptor lockDescriptor) {\n Optional<TableRefAndRemainder> tableRefAndRemainder = tryParseTableRef(lockDescriptor);\n if (!tableRefAndRemainder.isPresent()) {\n return ImmutableList.of();\n }\n\n TableReference t... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_408 | {
"fields": [
{
"declarator": "RECOMPUTE_MILLIS = 10",
"modifier": "private static final",
"original_string": "private static final long RECOMPUTE_MILLIS = 10;",
"type": "long",
"var_name": "RECOMPUTE_MILLIS"
},
{
"declarator": "METRICS_CONFIGURATION\n = Targ... | {
"body": "@Test\n public void entriesReadInBatchDoesNotClashAcrossStrategies() {\n metrics.registerEntriesReadInBatch(CONS_ZERO, 5);\n metrics.registerEntriesReadInBatch(CONS_ZERO, 10);\n metrics.registerEntriesReadInBatch(THOR_ZERO, 15);\n metrics.registerEntriesReadInBatch(THOR_ZERO,... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweepMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweepMetrics.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public void registerEntriesReadInBatch(ShardAndStrategy shardStrategy, long batchSize) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.registerEntriesReadInBatch(batchSize));\n }",
"class_method_signature": "TargetedSweepMetrics.registerEntriesReadInBatch(ShardAndStrategy shardStra... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_371 | {
"fields": [
{
"declarator": "renderTracingRule = new RenderTracingRule()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public RenderTracingRule renderTracingRule = new RenderTracingRule();",
"type": "RenderTracingRule",
"var_name": "renderTracingRule"
},
... | {
"body": "@Test\n public void flushesHaveTraces() throws Exception {\n TracingEventHandler<Integer, Long> tracingHandler =\n new TracingEventHandler<>(delegate, 10);\n\n DisruptorFuture<Long> eventFuture = Tracers.wrapListenableFuture(\"test\", () -> {\n TestBatchElement el... | {
"fields": [
{
"declarator": "handler",
"modifier": "private final",
"original_string": "private final EventHandler<BatchElement<I, O>> handler;",
"type": "EventHandler<BatchElement<I, O>>",
"var_name": "handler"
},
{
"declarator": "pending",
"modifier": "private... | {
"body": "@Override\n public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception {\n pending.add(event);\n if (endOfBatch) {\n pending.forEach(e -> e.result().running());\n handler.onEvent(event, sequence, true);\n pending.clear... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_721 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/ThrowablesTest.java",
"identifier": "ThrowablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRewrap() {\n try {\n throwTwoArgConstructorException();\n fail(\"Should not get here\");\n } catch (TwoArgConstructorException e) {\n TwoArgConstructorException wrapped = Throwables.rewrap(e);\n assertEquals(e.getMessage()... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Throwables.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(Throwables.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "atlasdb-commons/src/ma... | {
"body": "public static <T extends Throwable> T rewrap(T throwable) {\n Preconditions.checkNotNull(throwable);\n return rewrap(throwable.getMessage(), throwable);\n }",
"class_method_signature": "Throwables.rewrap(T throwable)",
"constructor": false,
"full_signature": "public static T rewrap(T... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_234 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowIfFirstMetricTagValueContainsSemiColon() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(METRIC_NAME,\n ImmutableMap.of(TAG_KEY_1, \"tag;Val1\", TAG_KEY_2, TAG_VALUE_2)))\n .isInstanceOf(IllegalArgumentExcept... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_664 | {
"fields": [
{
"declarator": "counter",
"modifier": "private",
"original_string": "private long counter;",
"type": "long",
"var_name": "counter"
},
{
"declarator": "supplierCounter",
"modifier": "private",
"original_string": "private long supplierCounter;",... | {
"body": "@Test\n public void appliesFunctionToNullValue() {\n when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0));\n assertThat(counter).isEqualTo(0);\n\n assertThat(testSupplier.get()).isNull();\n assertThat(counter).isEqualTo(1);\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "function",
"modifier": "private final",
"original_string": "private final Function<T, R> function;",
"type": "Function<T, R>",
"var_name": "function"
},
{
"declarator": "supplier",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public R get() {\n if (!Objects.equals(supplier.get().version(), lastSuppliedVersion)\n || lastComputedTime + maxTimeBetweenRecomputes < clock.getTimeMillis()) {\n recompute();\n }\n return cached;\n }",
"class_method_signature": "CachedCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_849 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "CLIEN... | {
"body": "@Test\n public void canOverwriteSequences() throws IOException {\n writeValueForRound(5L);\n PaxosValue newEntry = writeValueForRound(5L);\n assertThat(PaxosValue.BYTES_HYDRATOR.hydrateFromBytes(stateLog.readRound(5L))).isEqualTo(newEntry);\n }",
"class_method_signature": "Sqli... | {
"fields": [
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "private final Client namespace;",
"type": "Client",
"var_name": "namespace"
},
{
"declarator": "useCase",
"modifier": "private final",
"original_string": "private fin... | {
"body": "@Override\n public byte[] readRound(long seq) {\n return execute(dao -> dao.readRound(namespace, useCase, seq));\n }",
"class_method_signature": "SqlitePaxosStateLog.readRound(long seq)",
"constructor": false,
"full_signature": "@Override public byte[] readRound(long seq)",
"identifier... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_90 | {
"fields": [
{
"declarator": "CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\")",
"modifier": "private static final",
"original_string": "private static final List<String> CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\");",
"type": "List<String>",
"var... | {
"body": "@Test\n public void addProtocolsAddsHttpsIfSslPresent() {\n assertThat(PaxosRemotingUtils.addProtocols(SSL_TIMELOCK, ImmutableList.of(\"foo:1\", \"bar:2\")))\n .isEqualTo(ImmutableList.of(\"https://foo:1\", \"https://bar:2\"));\n }",
"class_method_signature": "PaxosRemotingUti... | {
"fields": [],
"file": "timelock-agent/src/main/java/com/palantir/timelock/paxos/PaxosRemotingUtils.java",
"identifier": "PaxosRemotingUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PaxosRemotingUtils.PaxosRemotingUtils()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static List<String> addProtocols(TimeLockInstallConfiguration install, List<String> addresses) {\n return addresses.stream()\n .map(address -> addProtocol(install, address))\n .collect(Collectors.toList());\n }",
"class_method_signature": "PaxosRemotingUtils... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_776 | {
"fields": [
{
"declarator": "KEY_1 = {120}",
"modifier": "private static final",
"original_string": "private static final byte[] KEY_1 = {120};",
"type": "byte[]",
"var_name": "KEY_1"
},
{
"declarator": "COLUMN_NAME_1 = \"foo\"",
"modifier": "private static fina... | {
"body": "@Test\n public void checkAndSetGeneratesBatchedStatements() {\n CqlQuery query = CassandraTimestampUtils.constructCheckAndSetMultipleQuery(\n ImmutableMap.of(COLUMN_NAME_1, Pair.create(VALUE_1, VALUE_2),\n COLUMN_NAME_2, Pair.create(VALUE_2, VALUE_1)));\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static CqlQuery constructCheckAndSetMultipleQuery(Map<String, Pair<byte[], byte[]>> checkAndSetRequest) {\n ImmutableCqlSinglePartitionBatchQuery.Builder batchQueryBuilder = CqlSinglePartitionBatchQuery.builder();\n checkAndSetRequest.forEach((columnName, value) ->\n bat... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_326 | {
"fields": [
{
"declarator": "TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\");",
"type"... | {
"body": "@Test\n public void canSpecifyTableReferenceAndRowComponentsAsSafeEvenWhenUsingDynamicColumns() {\n ImmutableSafeLoggableData.Builder builder = ImmutableSafeLoggableData.builder();\n SafeLoggableDataUtils.addLoggableNamesToBuilder(builder, TABLE_REFERENCE_1, TABLE_METADATA_DYNAMIC_COLUMNS)... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SafeLoggableDataUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SafeLoggableDataUtils.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@VisibleForTesting\n static void addLoggableNamesToBuilder(\n ImmutableSafeLoggableData.Builder builder,\n TableReference ref,\n TableMetadata tableMetadata) {\n if (IS_SAFE.test(tableMetadata.getNameLogSafety())) {\n builder.addPermittedTableReferences... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_633 | {
"fields": [
{
"declarator": "EXCEPTION = new IllegalStateException(\"bad\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException EXCEPTION = new IllegalStateException(\"bad\");",
"type": "RuntimeException",
"var_name": "EXCEPTION"
},
... | {
"body": "@Test\n public void returnsTerminalIfBoundEqualsFreshTimestamp() {\n TimestampCorroborationConsistencyCheck check = createForTimestamps(42, 42);\n assertThat(check.apply(mock(TransactionManager.class))).satisfies(\n result -> {\n assertThat(result.consiste... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampCorroborationConsistencyCheck.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampCorroborationConsistencyCheck.class);",
"type": "Logger",
... | {
"body": "@Override\n public TransactionManagerConsistencyResult apply(TransactionManager transactionManager) {\n // The ordering is important, because if we get a timestamp first, we may have a false positive if we have\n // a long GC between grabbing the fresh timestamp and the lower bound (e.g. i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_799 | {
"fields": [
{
"declarator": "ec2SnitchSupplier = () -> \"org.apache.cassandra.locator.Ec2Snitch\"",
"modifier": "private static final",
"original_string": "private static final Supplier<String> ec2SnitchSupplier = () -> \"org.apache.cassandra.locator.Ec2Snitch\";",
"type": "Supplier<Stri... | {
"body": "@Test\n public void shouldReturnEmptyLocationFromEc2Exception() {\n Supplier<HostLocation> ec2BadLocationSupplier = () -> {\n throw new RuntimeException();\n };\n\n Supplier<Optional<HostLocation>> hostLocationSupplier = new HostLocationSupplier(ec2SnitchSupplier,\n ... | {
"fields": [
{
"declarator": "snitchSupplier",
"modifier": "private final",
"original_string": "private final Supplier<String> snitchSupplier;",
"type": "Supplier<String>",
"var_name": "snitchSupplier"
},
{
"declarator": "ec2Supplier",
"modifier": "private final"... | {
"body": "@Override\n public Optional<HostLocation> get() {\n try {\n if (overrideLocation.isPresent()) {\n return overrideLocation;\n }\n\n String snitch = snitchSupplier.get();\n log.debug(\"Snitch successfully detected\", SafeArg.of(\"snitch\", ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_263 | {
"fields": [
{
"declarator": "DEFAULT_TABLE_METADATA = TableMetadata.allDefault()",
"modifier": "private static final",
"original_string": "private static final TableMetadata DEFAULT_TABLE_METADATA = TableMetadata.allDefault();",
"type": "TableMetadata",
"var_name": "DEFAULT_TABLE_M... | {
"body": "@Test\n public void nameIsNotLoggableByDefault() {\n assertThat(DEFAULT_TABLE_METADATA.getNameLogSafety()).isEqualTo(LogSafety.UNSAFE);\n }",
"class_method_signature": "TableMetadataTest.nameIsNotLoggableByDefault()",
"constructor": false,
"full_signature": "@Test public void nameIsNotLo... | {
"fields": [
{
"declarator": "BYTES_HYDRATOR = input -> {\n try {\n TableMetadataPersistence.TableMetadata message = TableMetadataPersistence.TableMetadata.parseFrom(input);\n return hydrateFromProto(message);\n } catch (InvalidProtocolBufferException e) {\n t... | {
"body": "@Value.Default\n public LogSafety getNameLogSafety() {\n return LogSafety.UNSAFE;\n }",
"class_method_signature": "TableMetadata.getNameLogSafety()",
"constructor": false,
"full_signature": "@Value.Default public LogSafety getNameLogSafety()",
"identifier": "getNameLogSafety",
"invoc... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_977 | {
"fields": [
{
"declarator": "LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =\n LockImmutableTimestampResponse.of(1L, LockToken.of(UUID.randomUUID()))",
"modifier": "private static final",
"original_string": "private static final LockImmutableTimestampResponse LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =... | {
"body": "@Test\n public void resilientUnderMultipleThreads() throws InterruptedException {\n BlockingTimestamp blockingTimestampReturning1 = new BlockingTimestamp(1);\n when(rawTimelockService.getFreshTimestamp())\n .thenAnswer(blockingTimestampReturning1)\n .thenRetur... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class);",
"type": "Logger",
... | {
"body": "@Override\n public long getFreshTimestamp() {\n return checkAndUpdateLowerBound(delegate::getFreshTimestamp, x -> x, x -> x, OperationType.TIMESTAMP);\n }",
"class_method_signature": "TimestampCorroboratingTimelockService.getFreshTimestamp()",
"constructor": false,
"full_signature": "@Ov... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_424 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void conservativeGetTimestampToSweepAddsSentinels() {\n long sweepTimestampHigherThanCommitTimestamp = HIGH_COMMIT_TS + 1;\n List<CandidateCellForSweeping> candidates = twoCommittedTimestampsForSingleCell();\n SweepableCellFilter filter = new SweepableCellFilter(\n ... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_131 | {
"fields": [
{
"declarator": "FUTURE_TIMESTAMP = 3141592653589L",
"modifier": "private static final",
"original_string": "private static final long FUTURE_TIMESTAMP = 3141592653589L;",
"type": "long",
"var_name": "FUTURE_TIMESTAMP"
},
{
"declarator": "TEST_TABLE = Tabl... | {
"body": "@Test\n public void migrateRevertsUncommittedWritesAndMigratesMostRecentlyCommitted() {\n fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES);\n fromTxManager.runTaskWithRetry(tx -> {\n tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1));\n return tx.getTimestamp... | {
"fields": [
{
"declarator": "printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueServiceMigrator.class))",
"modifier": "private static final",
"original_string": "private static final OutputPrinter printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueSe... | {
"body": "public static KeyValueServiceMigrator setupMigrator(MigratorSpec migratorSpec) {\n AtlasDbServices fromServices = migratorSpec.fromServices();\n AtlasDbServices toServices = migratorSpec.toServices();\n TimestampManagementService toTimestampManagementService = toServices.getManagedTime... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_561 | {
"fields": [
{
"declarator": "TABLE_STRING = \"ns.table\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_STRING = \"ns.table\";",
"type": "String",
"var_name": "TABLE_STRING"
},
{
"declarator": "TABLE = TableReference.create... | {
"body": "@Test\n public void sleepsForShortDurationIfCompactSucceeds() {\n assertThat(BackgroundCompactor.getSleepTime(\n () -> COMPACTOR_CONFIG,\n BackgroundCompactor.CompactionOutcome.SUCCESS))\n .isEqualTo(COMPACT_PAUSE_MILLIS);\n assertThat(Backgroun... | {
"fields": [
{
"declarator": "SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5)",
"modifier": "public static final",
"original_string": "public static final long SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5);",
"type": "long",
... | {
"body": "@VisibleForTesting\n static long getSleepTime(\n Supplier<CompactorConfig> compactorConfigSupplier,\n CompactionOutcome outcome) {\n switch (outcome) {\n case SUCCESS:\n case COMPACTED_BUT_NOT_REGISTERED:\n case SHUTDOWN:\n ret... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_832 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfigTest.java",
"identifier": "CassandraCellLoadingConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void cannotCreateConfigWithNonPositiveSingleQueryLoadBatchLimit() {\n assertThatThrownBy(() -> CassandraCellLoadingConfig.of(5, -24))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"singleQueryLoadBatchLimit should be positive\")... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfig.java",
"identifier": "CassandraCellLoadingConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraCellLoadingConfig.crossColumnLoadBatchLimit()",
"constructo... | {
"body": "static CassandraCellLoadingConfig of(int crossColumnLoadBatchLimit, int singleQueryLoadBatchLimit) {\n return ImmutableCassandraCellLoadingConfig.builder()\n .crossColumnLoadBatchLimit(crossColumnLoadBatchLimit)\n .singleQueryLoadBatchLimit(singleQueryLoadBatchLimit)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_998 | {
"fields": [
{
"declarator": "COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\")",
"modifier": "private static final",
"original_string": "private static final byte[] COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\");",
"type": "byte[]",
"var_name": "COORDINATION_ROW"
},
{
"dec... | {
"body": "@Test\n public void checkAndSetFailsIfOldValueNotCorrect() {\n coordinationStore.checkAndSetCoordinationValue(Optional.empty(), SEQUENCE_AND_BOUND_1);\n assertThat(coordinationStore.checkAndSetCoordinationValue(\n Optional.empty(), SEQUENCE_AND_BOUND_2))\n .is... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class);",
"type": "Logger",
"var_n... | {
"body": "@SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n @VisibleForTesting\n CheckAndSetResult<SequenceAndBound> checkAndSetCoordinationValue(\n Optional<SequenceAndBound> oldValue, SequenceAndBound newValue) {\n if (oldValue.map(presentOldValue -> Objects.equals(presentOldValue... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_648 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 10L",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 10L;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 20L",
"modifier": "private static ... | {
"body": "@Test\n public void getMillisForTimestampIfNotPunchedBeforeWhenLowerBoundIsNegative() {\n KeyValueService kvs = new InMemoryKeyValueService(false);\n puncherStore = initializePuncherStore(PUNCHER_HISTORY, kvs);\n // Punched: (10, 100), (20, 200), (30, 300)\n // Arguments: (15... | {
"fields": [
{
"declarator": "COLUMN = \"t\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] COLUMN = \"t\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_name": "COLUMN"
},
{
"declarato... | {
"body": "public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) {\n if (get(kvs, Math.max(0L, lowerBound)) < timestamp) {\n return getMillisForTimestamp(kvs, timestamp);\n } else {\n return lowerBound;\n }\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_218 | {
"fields": [
{
"declarator": "LOGIN = \"login\"",
"modifier": "private static final",
"original_string": "private static final String LOGIN = \"login\";",
"type": "String",
"var_name": "LOGIN"
},
{
"declarator": "HOST = \"host\"",
"modifier": "private static fina... | {
"body": "@Test\n public void throwsIfBothSidAndServiceNameConfigurationAreSpecified() {\n OracleConnectionConfig.Builder builder = getBaseBuilder()\n .sid(SID)\n .serviceNameConfiguration(SERVICE_NAME_CONFIGURATION);\n assertThatThrownBy(builder::build)\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(OracleConnectionConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(OracleConnectionConfig.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public abstract Optional<ServiceNameConfiguration> serviceNameConfiguration();",
"class_method_signature": "OracleConnectionConfig.serviceNameConfiguration()",
"constructor": false,
"full_signature": "public abstract Optional<ServiceNameConfiguration> serviceNameConfiguration()",
"identifier": "ser... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_189 | {
"fields": [
{
"declarator": "CLIENT_WHO_IS_LED = Client.of(\"client-1\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT_WHO_IS_LED = Client.of(\"client-1\");",
"type": "Client",
"var_name": "CLIENT_WHO_IS_LED"
},
{
"declar... | {
"body": "@Test\n public void secondIterationIncludesClientsFromPreviousIterations() {\n CumulativeLeaderPinger cumulativeLeaderPinger = new CumulativeLeaderPinger(\n pingerWithContext,\n Duration.ofSeconds(1),\n Duration.ofSeconds(1),\n HOST_UUID... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CumulativeLeaderPinger.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CumulativeLeaderPinger.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public Future<LeaderPingResult> registerAndPing(UUID requestedUuid, Client client) {\n // Register the client to be checked eventually. In the event that the client has not been in a ping request,\n // we return a future that will succeed when the *next* ping succeeds. In the s... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_473 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void sweepWithSingleEntryUpdatesMetrics() {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS);\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));\n\n assertThat(metricsManager).hasTombstonesPutConservativeEqualTo(1);\n assertThat(metricsManager).hasSweepTim... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_920 | {
"fields": [
{
"declarator": "SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5)",
"modifier": "private static final",
"original_string": "private static final Duration SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5);",
"type": "Duration",
"v... | {
"body": "@Test\n public void logsSlowestOperationIfMultipleOperationsExceedTheSlowThresholdIfFirst() {\n accumulateLogsWithCall(TWO_CENTURIES, profilingTimelockService::getFreshTimestamp);\n flushLogsWithCall(LONG_DURATION, () -> profilingTimelockService.startIdentifiedAtlasDbTransactionBatch(1));\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ProfilingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ProfilingTimelockService.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) {\n return runTaskTimed(\"startIdentifiedAtlasDbTransactionBatch\",\n () -> delegate.startIdentifiedAtlasDbTransactionBatch(count));\n }",
"class_method_signatu... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_865 | {
"fields": [
{
"declarator": "TEST_MESSAGE = \"test_message\"",
"modifier": "private static final",
"original_string": "private static final String TEST_MESSAGE = \"test_message\";",
"type": "String",
"var_name": "TEST_MESSAGE"
},
{
"declarator": "executor = Executors.... | {
"body": "@Test\n @SuppressWarnings(\"SelfEquals\")\n // We're asserting that calling .equals on a proxy does not redirect\n // the .equals call to the instance its being proxied.\n public void shouldAllowObjectMethodsWhenLeading() {\n Runnable proxy = AwaitingLeadershipProxy.newProxyInstance(\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static <U> U newProxyInstance(Class<U> interfaceClass,\n Supplier<U> delegateSupplier,\n LeaderElectionService leaderElectionService) {\n AwaitingLeadershipProxy<U> proxy = new AwaitingLeadershipProxy<>(\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_53 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldDelegateHandlingOfAllocationFailures() {\n RuntimeException failure = new RuntimeException();\n RuntimeException expectedException = new RuntimeException();\n\n doThrow(failure).when(delegate).storeUpperLimit(anyLong());\n when(allocationFailures.res... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TimestampBoundStore delegate;",
"type": "TimestampBoundStore",
"var_name": "delegate"
},
{
"declarator": "failures",
"modifier": "private final",
"origin... | {
"body": "@Override\n public synchronized void storeUpperLimit(long limit) {\n failures.verifyWeShouldIssueMoreTimestamps();\n throwIfInterrupted();\n\n try {\n delegate.storeUpperLimit(limit);\n } catch (Throwable t) {\n throw failures.responseTo(t);\n }\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_536 | {
"fields": [
{
"declarator": "VALID_START_TIMESTAMP = 100L",
"modifier": "private static final",
"original_string": "private static final Long VALID_START_TIMESTAMP = 100L;",
"type": "Long",
"var_name": "VALID_START_TIMESTAMP"
},
{
"declarator": "VALID_COMMIT_TIMESTAMP... | {
"body": "@Test\n public void loadShouldContinueIfKeyAlreadyExistsIsThrown() throws Exception {\n AtomicLong answerCount = new AtomicLong();\n\n doAnswer((invocation) -> answerCount.get() > 0 ? VALID_COMMIT_TIMESTAMP : NO_TIMESTAMP)\n .when(mockTransactionService).get(VALID_START_TIME... | {
"fields": [
{
"declarator": "ONE_MILLION = 1_000_000L",
"modifier": "private static final",
"original_string": "private static final Long ONE_MILLION = 1_000_000L;",
"type": "Long",
"var_name": "ONE_MILLION"
},
{
"declarator": "cache",
"modifier": "private",
... | {
"body": "public long load(long startTs) {\n return cache.get(startTs);\n }",
"class_method_signature": "CommitTsCache.load(long startTs)",
"constructor": false,
"full_signature": "public long load(long startTs)",
"identifier": "load",
"invocations": [
"get"
],
"modifiers": "public",
"p... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_166 | {
"fields": [
{
"declarator": "AUTH_HEADER = AuthHeader.valueOf(\"Bearer test\")",
"modifier": "private static final",
"original_string": "private static final AuthHeader AUTH_HEADER = AuthHeader.valueOf(\"Bearer test\");",
"type": "AuthHeader",
"var_name": "AUTH_HEADER"
},
{... | {
"body": "@Test\n public void canGetLeaderTime() {\n assertThat(Futures.getUnchecked(resource.leaderTime(AUTH_HEADER, NAMESPACE))).isEqualTo(leaderTime);\n }",
"class_method_signature": "ConjureTimelockResourceTest.canGetLeaderTime()",
"constructor": false,
"full_signature": "@Test public void can... | {
"fields": [
{
"declarator": "exceptionHandler",
"modifier": "private final",
"original_string": "private final ConjureResourceExceptionHandler exceptionHandler;",
"type": "ConjureResourceExceptionHandler",
"var_name": "exceptionHandler"
},
{
"declarator": "timelockSer... | {
"body": "@Override\n public ListenableFuture<LeaderTime> leaderTime(AuthHeader authHeader, String namespace) {\n return handleExceptions(() -> forNamespace(namespace).leaderTime());\n }",
"class_method_signature": "ConjureTimelockResource.leaderTime(AuthHeader authHeader, String namespace)",
"const... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_936 | {
"fields": [
{
"declarator": "USER_AGENT_1 = createBaseUserAgent(\"Bond\", \"0.0.7\")",
"modifier": "private static final",
"original_string": "private static final UserAgent USER_AGENT_1 = createBaseUserAgent(\"Bond\", \"0.0.7\");",
"type": "UserAgent",
"var_name": "USER_AGENT_1"
... | {
"body": "@Test\n public void returnsEmptyIfUserAgentStringCannotBeParsed() {\n assertThat(ProtocolAwareExceptionMapper.parseProtocolVersionFromUserAgentHeader(\n ImmutableList.of(\"I don't know what a user agent is!\")))\n .isEmpty();\n }",
"class_method_signature": "Pro... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ProtocolAwareExceptionMapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ProtocolAwareExceptionMapper.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@VisibleForTesting\n static Optional<String> parseProtocolVersionFromUserAgentHeader(@Nonnull List<String> userAgentHeader) {\n return userAgentHeader\n .stream()\n .map(UserAgents::tryParse)\n .map(UserAgent::informational)\n .flatMap(L... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_465 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void whenDisabledReduceTasksIgnoringCoolDown() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_SMALL,\n SUCCESS_SMALL,\n SUCCESS_SMALL,\n SweepIterationResults.disabled());\n\n scheduler.start... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_170 | {
"fields": [
{
"declarator": "AUTH_HEADER = AuthHeader.valueOf(\"Bearer test\")",
"modifier": "private static final",
"original_string": "private static final AuthHeader AUTH_HEADER = AuthHeader.valueOf(\"Bearer test\");",
"type": "AuthHeader",
"var_name": "AUTH_HEADER"
},
{... | {
"body": "@Test\n public void handlesNotCurrentLeader() {\n when(resource.leaderTime(AUTH_HEADER, NAMESPACE)).thenThrow(new NotCurrentLeaderException(\n \"\", HostAndPort.fromParts(\"localhost\", REMOTE_PORT)));\n assertQosExceptionThrownBy(resource.leaderTime(AUTH_HEADER, NAMESPACE),... | {
"fields": [
{
"declarator": "exceptionHandler",
"modifier": "private final",
"original_string": "private final ConjureResourceExceptionHandler exceptionHandler;",
"type": "ConjureResourceExceptionHandler",
"var_name": "exceptionHandler"
},
{
"declarator": "timelockSer... | {
"body": "@Override\n public ListenableFuture<LeaderTime> leaderTime(AuthHeader authHeader, String namespace) {\n return handleExceptions(() -> forNamespace(namespace).leaderTime());\n }",
"class_method_signature": "ConjureTimelockResource.leaderTime(AuthHeader authHeader, String namespace)",
"const... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_520 | {
"fields": [
{
"declarator": "SWEEP_TIMESTAMP = 3141592L",
"modifier": "private static final",
"original_string": "private static final long SWEEP_TIMESTAMP = 3141592L;",
"type": "long",
"var_name": "SWEEP_TIMESTAMP"
},
{
"declarator": "PROGRESS_TIMESTAMP = 16180L",
... | {
"body": "@Test\n public void noBatchesMeansEverythingSweptUpToTheSweepTimestamp() {\n SweepBatchWithPartitionInfo batchWithPartitionInfo = accumulator.toSweepBatch();\n\n assertThat(batchWithPartitionInfo.sweepBatch()).satisfies(batch -> {\n assertThat(batch.writes()).isEmpty();\n ... | {
"fields": [
{
"declarator": "accumulatedWrites = Lists.newArrayList()",
"modifier": "private final",
"original_string": "private final List<WriteInfo> accumulatedWrites = Lists.newArrayList();",
"type": "List<WriteInfo>",
"var_name": "accumulatedWrites"
},
{
"declarat... | {
"body": "SweepBatchWithPartitionInfo toSweepBatch() {\n SweepBatch sweepBatch = SweepBatch.of(\n getLatestWritesByCellReference(),\n DedicatedRows.of(accumulatedDedicatedRows),\n getLastSweptTimestamp(),\n nextBatchAvailable,\n entrie... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_45 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void canGetTimestampFromRangeIfItIsTheUpperBound() {\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 2, 10))\n .containsExactly(EIGHTY_TWO);\n }",
"class_method_signature": "TimestampRangesTest.canGetTimestampFromRangeIfItIsTheUpperBound()",
... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_873 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "CLIEN... | {
"body": "@Test\n public void canFetchAndCombineHistoriesSinceLastVerifiedState() {\n Set<PaxosValue> paxosValues\n = PaxosSerializationTestUtils.writeToLogs(acceptorLog, learnerLog, 1, 100);\n int lastVerified = 17;\n\n Set<PaxosValue> expectedPaxosValues = paxosValues\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() {\n Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap();\n\n PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences);\n\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_609 | {
"fields": [
{
"declarator": "METRIC_NAME = \"name\"",
"modifier": "private static final",
"original_string": "private static final String METRIC_NAME = \"name\";",
"type": "String",
"var_name": "METRIC_NAME"
},
{
"declarator": "STRING_CLASS = String.class",
"mod... | {
"body": "@Test\n public void metricIsOnlyRegisteredOnce() {\n Counter c1 = memoizing.createAndRegisterCounter(STRING_CLASS, METRIC_NAME, TABLE_REFERENCE);\n Counter c2 = memoizing.createAndRegisterCounter(STRING_CLASS, METRIC_NAME, TABLE_REFERENCE);\n\n assertThat(c1).isSameAs(c2);\n ... | {
"fields": [
{
"declarator": "metricSpecCounterCache",
"modifier": "private final",
"original_string": "private final LoadingCache<MetricSpec, Counter> metricSpecCounterCache;",
"type": "LoadingCache<MetricSpec, Counter>",
"var_name": "metricSpecCounterCache"
}
],
"file": "a... | {
"body": "@Override\n public <T> Counter createAndRegisterCounter(Class<T> clazz, String metricName, TableReference tableReference) {\n return metricSpecCounterCache.get(MetricSpec.of(clazz, metricName, tableReference));\n }",
"class_method_signature": "MemoizingTableLevelMetricsController.createAndRe... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_259 | {
"fields": [
{
"declarator": "TABLE_NAME = \"testTable\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_NAME = \"testTable\";",
"type": "String",
"var_name": "TABLE_NAME"
},
{
"declarator": "TABLE_REF = TableReference.create... | {
"body": "@Test\n public void testDeleteTablesForSweepSchema() {\n Set<TableReference> allTableNames = Sets.newHashSet();\n allTableNames.add(TableReference.createFromFullyQualifiedName(\"sweep.priority\"));\n\n mockery.checking(new Expectations(){{\n oneOf(kvs).getAllTableNames();... | {
"fields": [
{
"declarator": "INDEX_SUFFIX = \"idx\"",
"modifier": "private static final",
"original_string": "private static final String INDEX_SUFFIX = \"idx\";",
"type": "String",
"var_name": "INDEX_SUFFIX"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/t... | {
"body": "public static void deleteTablesAndIndexes(Schema schema, KeyValueService kvs) {\n schema.validate();\n kvs.dropTables(getExistingTablesAlsoPresentInSchema(schema, kvs));\n }",
"class_method_signature": "Schemas.deleteTablesAndIndexes(Schema schema, KeyValueService kvs)",
"constructor":... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_432 | {
"fields": [
{
"declarator": "INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP",
"modifier": "private static final",
"original_string": "private static final long INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP;",
"type": "long",
"var_name": "INITIAL_TIMESTAMP"
},
... | {
"body": "@Test\n public void increasingNumberOfShardsAboveMaxThrows() {\n assertThatThrownBy(() -> progress.updateNumberOfShards(AtlasDbConstants.MAX_SWEEP_QUEUE_SHARDS + 1))\n .isInstanceOf(IllegalArgumentException.class);\n }",
"class_method_signature": "ShardProgressTest.increasingN... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ShardProgress.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ShardProgress.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "public int updateNumberOfShards(int newNumber) {\n Preconditions.checkArgument(newNumber <= AtlasDbConstants.MAX_SWEEP_QUEUE_SHARDS);\n return (int) increaseValueFromToAtLeast(SHARD_COUNT_SAS, getNumberOfShards(), newNumber);\n }",
"class_method_signature": "ShardProgress.updateNumberOfS... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_598 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void ignoreUnknownFailsIfSeeingATimestampServiceItDoesNotRecognizeForSingleTimestamps() {\n assertThatThrownBy(() -> lastDigitFiveImpliesUnknownTransactionService.get(7L))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Could not... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(keyedSyncServices, startTimestamp));\n }",
"class_method_signature": "SplitKeyDelegatingTransactionService.get(long startTimestamp)",
"constructor": false,
"full_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_961 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "USER_AGENT_NAME = \"user-agent\"",
"m... | {
"body": "@Test\n public void timelockServiceStatusReturnsHealthyAfterSuccessfulRequests() {\n TransactionManager tm = TransactionManagers.createInMemory(GenericTestSchema.getSchema());\n tm.getUnreadableTimestamp();\n assertTrue(tm.getTimelockServiceStatus().isHealthy());\n }",
"class_m... | {
"fields": [
{
"declarator": "LOGGING_INTERVAL = 60",
"modifier": "private static final",
"original_string": "private static final int LOGGING_INTERVAL = 60;",
"type": "int",
"var_name": "LOGGING_INTERVAL"
},
{
"declarator": "log = LoggerFactory.getLogger(TransactionMa... | {
"body": "public static TransactionManager createInMemory(Schema schema) {\n return createInMemory(ImmutableSet.of(schema));\n }",
"class_method_signature": "TransactionManagers.createInMemory(Schema schema)",
"constructor": false,
"full_signature": "public static TransactionManager createInMemory(Sc... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_824 | {
"fields": [
{
"declarator": "KEYSPACE = \"ks\"",
"modifier": "private static final",
"original_string": "private static final String KEYSPACE = \"ks\";",
"type": "String",
"var_name": "KEYSPACE"
},
{
"declarator": "KEYSPACE_2 = \"ks2\"",
"modifier": "private sta... | {
"body": "@Test\n public void emptyRuntimeConfigShouldResolveToDefaultConfig() {\n CassandraKeyValueServiceRuntimeConfig returnedConfig = new CassandraAtlasDbFactory()\n .preprocessKvsRuntimeConfig(Optional::empty)\n .get();\n\n assertEquals(\"Empty config should resolv... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n Supplier<CassandraKeyValueServiceRuntimeConfig> preprocessKvsRuntimeConfig(\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig) {\n return () -> {\n Optional<KeyValueServiceRuntimeConfig> configOptional = runtimeConfig.get();\n\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_577 | {
"fields": [
{
"declarator": "INTERNAL_SCHEMA_METADATA = InternalSchemaMetadata.builder()\n .timestampToTransactionsTableSchemaVersion(\n TimestampPartitioningMap.of(\n ImmutableRangeMap.<Long, Integer>builder()\n .... | {
"body": "@Test\n public void canDeserializeV1Metadata() throws URISyntaxException, IOException {\n String resourcePath = getResourcePath(\"internalschema-persistence/versioned-metadata-v1-1.json\");\n byte[] bytes = Files.readAllBytes(Paths.get(resourcePath));\n VersionedInternalSchemaMetada... | {
"fields": [
{
"declarator": "LATEST_VERSION = 1",
"modifier": "public static final",
"original_string": "public static final int LATEST_VERSION = 1;",
"type": "int",
"var_name": "LATEST_VERSION"
},
{
"declarator": "SUPPORTED_DECODERS =\n ImmutableMap.of(LAT... | {
"body": "static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) {\n return tryDecode(versionedInternalSchemaMetadata)\n .orElseThrow(() -> new SafeIllegalStateException(\"Could not decode persisted internal schema metadata -\"\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_12 | {
"fields": [
{
"declarator": "METRIC_NAME_1 = MetricName.builder()\n .safeName(\"com.palantir.atlasdb.metrics.metrics.p99\")\n .build()",
"modifier": "private static final",
"original_string": "private static final MetricName METRIC_NAME_1 = MetricName.builder()\n ... | {
"body": "@Test\n public void deduplicatesFilters() {\n Map<MetricName, Set<MetricPublicationArbiter.DeduplicatingFilterHolder>> filters = new HashMap<>();\n MetricPublicationArbiter arbiter = new MetricPublicationArbiter(filters);\n for (int i = 0; i < 100; i++) {\n int index = i;... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(MetricPublicationArbiter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(MetricPublicationArbiter.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "public void registerMetricsFilter(MetricName metricName, MetricPublicationFilter filter) {\n singleMetricFilters.merge(metricName,\n ImmutableSet.of(ImmutableDeduplicatingFilterHolder.of(filter)),\n (oldFilters, newFilter) ->\n ImmutableSet.<Dedup... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_127 | {
"fields": [
{
"declarator": "FUTURE_TIMESTAMP = 3141592653589L",
"modifier": "private static final",
"original_string": "private static final long FUTURE_TIMESTAMP = 3141592653589L;",
"type": "long",
"var_name": "FUTURE_TIMESTAMP"
},
{
"declarator": "TEST_TABLE = Tabl... | {
"body": "@Test\n public void setupClearsOutExistingTablesExceptAtomic() {\n toKvs.createTables(TEST_AND_CHECKPOINT_TABLES);\n fromKvs.dropTables(fromKvs.getAllTableNames());\n\n KeyValueServiceMigrator migrator = KeyValueServiceMigrators.setupMigrator(migratorSpec);\n migrator.setup()... | {
"fields": [
{
"declarator": "printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueServiceMigrator.class))",
"modifier": "private static final",
"original_string": "private static final OutputPrinter printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueSe... | {
"body": "public static KeyValueServiceMigrator setupMigrator(MigratorSpec migratorSpec) {\n AtlasDbServices fromServices = migratorSpec.fromServices();\n AtlasDbServices toServices = migratorSpec.toServices();\n TimestampManagementService toTimestampManagementService = toServices.getManagedTime... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_296 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "ROW_... | {
"body": "@Test\n public void getDelegates() throws Exception {\n Collection<? extends KeyValueService> delegates = kvs.getDelegates();\n\n checkSpan(\"atlasdb-kvs.getDelegates()\");\n assertThat(delegates, hasSize(1));\n assertThat(delegates.iterator().next(), equalTo(delegate));\n ... | {
"fields": [
{
"declarator": "SERVICE_NAME = \"atlasdb-kvs\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"atlasdb-kvs\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "delegate",
"modif... | {
"body": "@Override\n public Collection<? extends KeyValueService> getDelegates() {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"getDelegates()\")) {\n return ImmutableList.copyOf(Iterables.concat(ImmutableList.of(delegate()), d... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_629 | {
"fields": [
{
"declarator": "timelockService = mock(TimelockService.class)",
"modifier": "private final",
"original_string": "private final TimelockService timelockService = mock(TimelockService.class);",
"type": "TimelockService",
"var_name": "timelockService"
},
{
"... | {
"body": "@Test\n public void shouldRethrowNonRetriableException() throws Exception {\n Exception exception = new TransactionFailedNonRetriableException(\"msg\");\n when(delegate.execute(transaction)).thenThrow(exception);\n assertThatThrownBy(() -> wrappingTask.execute(transaction)).isEqualT... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionTask<T, E> delegate;",
"type": "TransactionTask<T, E>",
"var_name": "delegate"
},
{
"declarator": "timelockService",
"modifier": "private final",
... | {
"body": "@Override public T execute(Transaction transaction) throws E {\n try {\n return delegate.execute(transaction);\n } catch (Exception ex) {\n if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) {\n throw ex;\n }\n th... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_783 | {
"fields": [
{
"declarator": "KEY_1 = {120}",
"modifier": "private static final",
"original_string": "private static final byte[] KEY_1 = {120};",
"type": "byte[]",
"var_name": "KEY_1"
},
{
"declarator": "COLUMN_NAME_1 = \"foo\"",
"modifier": "private static fina... | {
"body": "@Test\n public void unappliedResultIsIncompatibleIfWeHaveMissingRows() {\n CqlResult mockResult = createMockCqlResult(\n ImmutableList.of(\n createMockCqlRow(buildUnappliedColumnList(COLUMN_BYTES_1, VALUE_1))));\n assertThatThrownBy(() -> CassandraTime... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static void verifyCompatible(CqlResult casResult, Map<String, Pair<byte[], byte[]>> casMap) {\n if (!isSuccessfullyApplied(casResult)) {\n Set<Incongruency> incongruencies = getIncongruencies(casResult, casMap);\n if (!incongruencies.isEmpty()) {\n throw n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_279 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "TABL... | {
"body": "@Test\n public void getTraceLogPresentOnTraceLevel() {\n Appender mockAppender = setLogLevelAndGetAppender(Level.TRACE);\n\n kvs.get(TABLE_REF, timestampByCell);\n\n verify(mockAppender).doAppend(traceLogMatcher.get());\n }",
"class_method_signature": "ProfilingKeyValueServiceT... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final KeyValueService delegate;",
"type": "KeyValueService",
"var_name": "delegate"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/ProfilingKeyVal... | {
"body": "@Override\n public Map<Cell, Value> get(TableReference tableRef, Map<Cell, Long> timestampByCell) {\n long startTime = System.currentTimeMillis();\n return KvsProfilingLogger.maybeLog(() -> delegate.get(tableRef, timestampByCell),\n (logger, stopwatch) ->\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_150 | {
"fields": [
{
"declarator": "CLIENT_A = \"a-client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT_A = \"a-client\";",
"type": "String",
"var_name": "CLIENT_A"
},
{
"declarator": "CLIENT_B = \"b-client\"",
"modifier... | {
"body": "@Test\n public void numberOfActiveClientsUpdatesAsNewClientsCreated() {\n assertNumberOfActiveClientsIs(0);\n assertMaxClientsIs(DEFAULT_MAX_NUMBER_OF_CLIENTS);\n\n namespaces.get(uniqueClient());\n\n assertNumberOfActiveClientsIs(1);\n assertMaxClientsIs(DEFAULT_MAX_N... | {
"fields": [
{
"declarator": "ACTIVE_CLIENTS = \"activeClients\"",
"modifier": "@VisibleForTesting static final",
"original_string": "@VisibleForTesting static final String ACTIVE_CLIENTS = \"activeClients\";",
"type": "String",
"var_name": "ACTIVE_CLIENTS"
},
{
"decla... | {
"body": "public TimeLockServices get(String namespace) {\n return services.computeIfAbsent(namespace, this::createNewClient);\n }",
"class_method_signature": "TimelockNamespaces.get(String namespace)",
"constructor": false,
"full_signature": "public TimeLockServices get(String namespace)",
"identi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_500 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void doNotDeleteAnythingAfterEntryWithCommitTsAfterSweepTs() {\n immutableTs = 1000L;\n enqueueWriteUncommitted(TABLE_CONS, 900);\n enqueueWriteUncommitted(TABLE_CONS, 920);\n enqueueWriteCommitedAt(TABLE_CONS, 950, 2000);\n enqueueWriteUncommitted(TABLE... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_65 | {
"fields": [
{
"declarator": "FAILURE = new IllegalStateException()",
"modifier": "private static final",
"original_string": "private static final RuntimeException FAILURE = new IllegalStateException();",
"type": "RuntimeException",
"var_name": "FAILURE"
},
{
"declarat... | {
"body": "@SuppressWarnings(\"Slf4jConstantLogMessage\")\n @Test public void\n shouldLog2DifferentExceptionsToError() {\n ignoringExceptions(() -> allocationFailures.responseTo(FAILURE));\n ignoringExceptions(() -> allocationFailures.responseTo(MULTIPLE_RUNNING_SERVICES_FAILURE));\n\n veri... | {
"fields": [
{
"declarator": "MULTIPLE_RUNNING_TIMESTAMP_SERVICES_MESSAGE =\n \"This server is no longer usable as there appears to be another timestamp server running.\"",
"modifier": "private static final",
"original_string": "private static final String MULTIPLE_RUNNING_TIMESTAMP_... | {
"body": "public RuntimeException responseTo(Throwable newFailure) {\n synchronized (this) {\n logNewFailure(newFailure);\n previousAllocationFailure = newFailure;\n }\n\n if (newFailure instanceof MultipleRunningTimestampServiceError) {\n encounteredMultipleRunn... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_853 | {
"fields": [
{
"declarator": "START_SEQUENCE = 123",
"modifier": "private static final",
"original_string": "private static final int START_SEQUENCE = 123;",
"type": "int",
"var_name": "START_SEQUENCE"
},
{
"declarator": "BATCH_SIZE = 250",
"modifier": "private s... | {
"body": "@Test\n public void exceptionsArePropagated() throws IOException {\n IOException ioException = new IOException(\"test\");\n when(mockLog.readRound(anyLong()))\n .thenAnswer(invocation -> {\n long sequence = (long) invocation.getArguments()[0];\n ... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final PaxosStateLog<V> delegate;",
"type": "PaxosStateLog<V>",
"var_name": "delegate"
},
{
"declarator": "hydrator",
"modifier": "private final",
"original_str... | {
"body": "public List<PaxosRound<V>> readBatch(long startSequence, int numEntries) {\n return AtlasFutures.getUnchecked(\n Futures.allAsList(\n LongStream.range(startSequence, startSequence + numEntries)\n .mapToObj(sequence -> executor.subm... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_916 | {
"fields": [
{
"declarator": "SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5)",
"modifier": "private static final",
"original_string": "private static final Duration SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5);",
"type": "Duration",
"v... | {
"body": "@Test\n public void returnsResultReturnedByDelegate() {\n when(profilingTimelockService.getFreshTimestamp()).thenReturn(42L);\n assertThat(profilingTimelockService.getFreshTimestamp()).isEqualTo(42L);\n }",
"class_method_signature": "ProfilingTimelockServiceTest.returnsResultReturnedB... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ProfilingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ProfilingTimelockService.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public long getFreshTimestamp() {\n return runTaskTimed(\"getFreshTimestamp\", delegate::getFreshTimestamp);\n }",
"class_method_signature": "ProfilingTimelockService.getFreshTimestamp()",
"constructor": false,
"full_signature": "@Override public long getFreshTimestamp()",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_445 | {
"fields": [
{
"declarator": "mockLockService = mock(TimelockService.class)",
"modifier": "private",
"original_string": "private TimelockService mockLockService = mock(TimelockService.class);",
"type": "TimelockService",
"var_name": "mockLockService"
}
],
"file": "atlasdb-im... | {
"body": "@Test\n public void unsuccessfulLock() throws InterruptedException {\n when(mockLockService.lock(any())).thenReturn(() -> Optional.empty());\n Optional<TargetedSweeperLock> maybeLock = TargetedSweeperLock\n .tryAcquire(2, SweeperStrategy.THOROUGH, mockLockService);\n\n ... | {
"fields": [
{
"declarator": "shardStrategy",
"modifier": "private final",
"original_string": "private final ShardAndStrategy shardStrategy;",
"type": "ShardAndStrategy",
"var_name": "shardStrategy"
},
{
"declarator": "timeLock",
"modifier": "private final",
... | {
"body": "public static Optional<TargetedSweeperLock> tryAcquire(int shard, SweeperStrategy strategy,\n TimelockService timeLock) {\n ShardAndStrategy shardStrategy = ShardAndStrategy.of(shard, strategy);\n // We do not want the timeout to be too low to avoid a race condition where we give u... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_691 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/async/initializer/CallbackTest.java",
"identifier": "CallbackTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void runWithRetryStopsRetryingOnSuccess() {\n CountingCallback countingCallback = new CountingCallback(false);\n AtomicLong counter = new AtomicLong(0);\n\n countingCallback.runWithRetry(counter);\n\n assertThat(counter.get()).isEqualTo(10L);\n }",
"class_... | {
"fields": [
{
"declarator": "shutdownSignal = false",
"modifier": "private volatile",
"original_string": "private volatile boolean shutdownSignal = false;",
"type": "boolean",
"var_name": "shutdownSignal"
}
],
"file": "atlasdb-commons/src/main/java/com/palantir/async/initia... | {
"body": "public synchronized void runWithRetry(R resource) {\n while (!shutdownSignal) {\n try {\n if (!shutdownSignal) {\n init(resource);\n }\n return;\n } catch (Throwable e) {\n cleanup(resource, e);\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_384 | {
"fields": [
{
"declarator": "factory = new InMemoryAtlasDbFactory()",
"modifier": "private final",
"original_string": "private final AtlasDbFactory factory = new InMemoryAtlasDbFactory();",
"type": "AtlasDbFactory",
"var_name": "factory"
}
],
"file": "atlasdb-impl-shared/sr... | {
"body": "@Test\n public void syncInitTimestampServiceSynchronous() {\n TimestampService timestampService = factory.createManagedTimestampService(null, Optional.empty(), false);\n assertThat(timestampService.isInitialized()).isTrue();\n assertThat(timestampService.getFreshTimestamp()).isEqual... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(InMemoryAtlasDbFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(InMemoryAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
}
... | {
"body": "@Override\n public ManagedTimestampService createManagedTimestampService(\n KeyValueService rawKvs,\n Optional<TableReference> unused,\n boolean initializeAsync) {\n if (initializeAsync) {\n log.warn(\"Asynchronous initialization not implemented, will i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_804 | {
"fields": [
{
"declarator": "BYTES1 = ByteBuffer.allocate(3)",
"modifier": "private static final",
"original_string": "private static final ByteBuffer BYTES1 = ByteBuffer.allocate(3);",
"type": "ByteBuffer",
"var_name": "BYTES1"
},
{
"declarator": "BYTES2 = ByteBuffer... | {
"body": "@Test\n public void multigetSliceWeigherReturnsDefaultEstimateForFailure() {\n assertThatWeighFailureReturnsDefaultWeight(ThriftQueryWeighers.multigetSlice(ImmutableList.of(BYTES1)));\n }",
"class_method_signature": "ThriftQueryWeighersTest.multigetSliceWeigherReturnsDefaultEstimateForFailur... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraClient.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "public static QueryWeigher<Map<ByteBuffer, List<ColumnOrSuperColumn>>> multigetSlice(List<ByteBuffer> keys) {\n return readWeigher(ThriftObjectSizeUtils::getApproximateSizeOfColsByKey, Map::size, keys.size());\n }",
"class_method_signature": "ThriftQueryWeighers.multigetSlice(List<ByteBuffer> k... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_557 | {
"fields": [
{
"declarator": "TABLE_STRING = \"ns.table\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_STRING = \"ns.table\";",
"type": "String",
"var_name": "TABLE_STRING"
},
{
"declarator": "TABLE = TableReference.create... | {
"body": "@Test\n public void canReturnCompactionFailure() throws InterruptedException {\n doThrow(new RuntimeException())\n .when(kvs).compactInternally(TABLE, true);\n\n BackgroundCompactor.CompactionOutcome outcome = compactor.grabLockAndRunOnce(lockService);\n assertThat(ou... | {
"fields": [
{
"declarator": "SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5)",
"modifier": "public static final",
"original_string": "public static final long SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5);",
"type": "long",
... | {
"body": "@VisibleForTesting\n CompactionOutcome grabLockAndRunOnce(SingleLockService compactorLock)\n throws InterruptedException {\n CompactorConfig config = compactorConfigSupplier.get();\n if (!config.enableCompaction()) {\n log.debug(\"Skipping compaction because it is cur... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_32 | {
"fields": [
{
"declarator": "TEST_PREFIX = \"a_\"",
"modifier": "private static final",
"original_string": "private static final String TEST_PREFIX = \"a_\";",
"type": "String",
"var_name": "TEST_PREFIX"
},
{
"declarator": "TEST_NAMESPACE = Namespace.create(\"test_nam... | {
"body": "@Test\n public void shouldModifyTableNameForShortTableName() {\n when(resultSet.size()).thenReturn(0);\n\n TableReference tableRef = TableReference.create(Namespace.create(\"ns1\"), \"short\");\n String shortPrefixedTableName = oracleTableNameMapper\n .getShortPrefixe... | {
"fields": [
{
"declarator": "SUFFIX_NUMBER_LENGTH = 4",
"modifier": "public static final",
"original_string": "public static final int SUFFIX_NUMBER_LENGTH = 4;",
"type": "int",
"var_name": "SUFFIX_NUMBER_LENGTH"
},
{
"declarator": "MAX_NAMESPACE_LENGTH = 2",
"m... | {
"body": "public String getShortPrefixedTableName(\n ConnectionSupplier connectionSupplier,\n String tablePrefix,\n TableReference tableRef) {\n Preconditions.checkState(tablePrefix.length() <= AtlasDbConstants.MAX_TABLE_PREFIX_LENGTH,\n \"The tablePrefix can be... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_107 | {
"fields": [
{
"declarator": "LOCK_CLIENT = LockClient.of(\"foo\")",
"modifier": "private static final",
"original_string": "private static final LockClient LOCK_CLIENT = LockClient.of(\"foo\");",
"type": "LockClient",
"var_name": "LOCK_CLIENT"
},
{
"declarator": "FRES... | {
"body": "@Test\n public void refreshLockLeasesDelegatesToLockService() {\n Set<LockToken> tokens = ImmutableSet.of(LOCK_TOKEN_V2);\n timelock.refreshLockLeases(tokens);\n\n verify(lockService).refreshLockRefreshTokens(ImmutableSet.of(LOCK_REFRESH_TOKEN));\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "lockService",
"modifier": "private ... | {
"body": "@Override\n public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) {\n Set<LockRefreshToken> refreshTokens = tokens.stream()\n .map(LockTokenConverter::toLegacyToken)\n .collect(Collectors.toSet());\n return lockService.refreshLockRefreshTokens(refresh... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_412 | {
"fields": [
{
"declarator": "enqueuedWrites = new AtomicLong()",
"modifier": "private final",
"original_string": "private final AtomicLong enqueuedWrites = new AtomicLong();",
"type": "AtomicLong",
"var_name": "enqueuedWrites"
},
{
"declarator": "entriesRead = new Ato... | {
"body": "@Test\n public void shouldBePublishedAfterWritingManyValues() {\n enqueuedWrites.addAndGet(TargetedSweepMetricPublicationFilter.MINIMUM_READS_WRITES_TO_BE_CONSIDERED_ACTIVE);\n\n assertThat(filter.shouldPublish()).isTrue();\n }",
"class_method_signature": "TargetedSweepMetricPublicati... | {
"fields": [
{
"declarator": "MINIMUM_READS_WRITES_TO_BE_CONSIDERED_ACTIVE = 1_000",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final long MINIMUM_READS_WRITES_TO_BE_CONSIDERED_ACTIVE = 1_000;",
"type": "long",
"var_name": ... | {
"body": "@Override\n public boolean shouldPublish() {\n if (publicationLatch.get()) {\n return true;\n }\n boolean conditionsAchieved = testConditions();\n if (conditionsAchieved) {\n publicationLatch.set(true);\n }\n return conditionsAchieved;\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_941 | {
"fields": [
{
"declarator": "LOCALHOST = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String LOCALHOST = \"localhost\";",
"type": "String",
"var_name": "LOCALHOST"
},
{
"declarator": "GET_ENDPOINT = \"/number\"",
"... | {
"body": "@Test\n public void directProxyIsConfigurableOnClientRequests() {\n TestResource clientWithDirectCall = AtlasDbHttpClients.createProxyWithFailover(\n MetricsManagers.createForTests(),\n ImmutableServerListConfig.builder()\n .addServers(getUriFo... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java",
"identifier": "AtlasDbHttpClients",
"interfaces": "",
"methods": [
{
"class_method_signature": "AtlasDbHttpClients.AtlasDbHttpClients()",
"constructor": true,
"full_signature": "priv... | {
"body": "public static <T> T createProxyWithFailover(\n MetricsManager metricsManager,\n ServerListConfig serverListConfig,\n Class<T> type,\n AuxiliaryRemotingParameters parameters) {\n Supplier<T> clientFactory = () -> instrument(\n metricsManager.... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_687 | {
"fields": [
{
"declarator": "INIT_FAIL = new RuntimeException(\"Failed during initialization.\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException INIT_FAIL = new RuntimeException(\"Failed during initialization.\");",
"type": "RuntimeExceptio... | {
"body": "@Test\n public void retryingCallbackCallsInitializeAndCleanupUntilSuccess() {\n callback = LambdaCallback.retrying(this::markInitThenFailIfFewerThatTenInits, this::markCleanup);\n\n callback.runWithRetry(initsAndCleanups);\n assertThat(initsAndCleanups.inits()).isEqualTo(10);\n ... | {
"fields": [
{
"declarator": "FAIL = (ignore, throwable) -> {\n throw Throwables.rewrapAndThrowUncheckedException(throwable);\n }",
"modifier": "private static final",
"original_string": "private static final BiConsumer<Object, Throwable> FAIL = (ignore, throwable) -> {\n throw... | {
"body": "public static <R> Callback<R> retrying(Consumer<R> initialize, BiConsumer<R, Throwable> onInitFailureCleanup) {\n return new LambdaCallback<>(initialize, onInitFailureCleanup);\n }",
"class_method_signature": "LambdaCallback.retrying(Consumer<R> initialize, BiConsumer<R, Throwable> onInitFailur... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_392 | {
"fields": [
{
"declarator": "FQ_TABLE = TableReference.createFromFullyQualifiedName(\"test.test\")",
"modifier": "private static final",
"original_string": "private static final TableReference FQ_TABLE = TableReference.createFromFullyQualifiedName(\"test.test\");",
"type": "TableReferenc... | {
"body": "@Test\n public void mapToShortTableNamesThrowsOnNonExistentTable() {\n assertThatThrownBy(() -> tableMapping.mapToShortTableNames(ImmutableMap.of(FQ_TABLE2, 22L)))\n .as(\"Table was never added\")\n .isInstanceOf(TableMappingNotFoundException.class);\n }",
"clas... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KvTableMappingService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KvTableMappingService.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public <T> Map<TableReference, T> mapToShortTableNames(Map<TableReference, T> toMap)\n throws TableMappingNotFoundException {\n Map<TableReference, T> newMap = Maps.newHashMap();\n for (Map.Entry<TableReference, T> e : toMap.entrySet()) {\n newMap.put(getM... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_668 | {
"fields": [
{
"declarator": "counter",
"modifier": "private",
"original_string": "private long counter;",
"type": "long",
"var_name": "counter"
},
{
"declarator": "supplierCounter",
"modifier": "private",
"original_string": "private long supplierCounter;",... | {
"body": "@Test\n public void recomputesIfSupplierHasNotUpdatedForTooLong() throws InterruptedException {\n AtomicLong clockCounter = new AtomicLong();\n testSupplier = new CachedComposedSupplier<>(this::countingFunction, this::constantNumber,\n 5, () -> clockCounter.get());\n ... | {
"fields": [
{
"declarator": "function",
"modifier": "private final",
"original_string": "private final Function<T, R> function;",
"type": "Function<T, R>",
"var_name": "function"
},
{
"declarator": "supplier",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public R get() {\n if (!Objects.equals(supplier.get().version(), lastSuppliedVersion)\n || lastComputedTime + maxTimeBetweenRecomputes < clock.getTimeMillis()) {\n recompute();\n }\n return cached;\n }",
"class_method_signature": "CachedCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_238 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowForFirstEncounteredErrorMultipleMetricArgsContainInvalidCharacters() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(\"metric;Name\",\n ImmutableMap.of(\"tag;1\", TAG_VALUE_1, TAG_KEY_2, \"tagVal=2\")))\n .is... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_111 | {
"fields": [
{
"declarator": "SLOW_LOG_TRIGGER_MILLIS = LockServiceImpl.DEBUG_SLOW_LOG_TRIGGER_MILLIS + 10",
"modifier": "public static final",
"original_string": "public static final long SLOW_LOG_TRIGGER_MILLIS = LockServiceImpl.DEBUG_SLOW_LOG_TRIGGER_MILLIS + 10;",
"type": "long",
... | {
"body": "@Test\n public void slowLogShouldBeEnabledIfSlowLogTriggerMillisIsSetToPositiveValue() {\n assertThat(lockServiceWithSlowLogEnabled.isSlowLogEnabled(), is(true));\n }",
"class_method_signature": "LockServiceImplTest.slowLogShouldBeEnabledIfSlowLogTriggerMillisIsSetToPositiveValue()",
"cons... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LockServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(LockServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@VisibleForTesting\n protected boolean isSlowLogEnabled() {\n return slowLogTriggerMillis > 0;\n }",
"class_method_signature": "LockServiceImpl.isSlowLogEnabled()",
"constructor": false,
"full_signature": "@VisibleForTesting protected boolean isSlowLogEnabled()",
"identifier": "isSlowL... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_24 | {
"fields": [
{
"declarator": "TABLE = TableReference.createFromFullyQualifiedName(\"test.table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE = TableReference.createFromFullyQualifiedName(\"test.table\");",
"type": "TableReference",
... | {
"body": "@Test\n public void uniqueCellLockDescriptorIsDecodedCorrectlyForCells() {\n LockDescriptor descriptor = AtlasCellLockDescriptor.of(TABLE.getQualifiedName(), NO_ZERO_ROW, NO_ZERO_COL);\n assertThat(AtlasLockDescriptorUtils.candidateCells(descriptor))\n .containsExactly(CellR... | {
"fields": [],
"file": "atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/AtlasLockDescriptorUtils.java",
"identifier": "AtlasLockDescriptorUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "AtlasLockDescriptorUtils.AtlasLockDescriptorUtils()",
"constructor": true,
... | {
"body": "public static List<CellReference> candidateCells(LockDescriptor lockDescriptor) {\n Optional<TableRefAndRemainder> tableRefAndRemainder = tryParseTableRef(lockDescriptor);\n if (!tableRefAndRemainder.isPresent()) {\n return ImmutableList.of();\n }\n\n TableReference t... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_541 | {
"fields": [
{
"declarator": "ONE = 1L",
"modifier": "private static final",
"original_string": "private static final long ONE = 1L;",
"type": "long",
"var_name": "ONE"
},
{
"declarator": "TEN = 10L",
"modifier": "private static final",
"original_string": "... | {
"body": "@Test\n public void doesNotCallSupplierUnlessGaugeIsQueried() {\n when(mockClock.getTick()).thenReturn(0L, CACHE_INTERVAL_NANOS * 50000);\n AtomicLong timestampValue = new AtomicLong(0L);\n TimestampTracker.registerTimestampForTracking(\n mockClock, metricsManager, FA... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampTracker.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampTracker.class);",
"type": "Logger",
"var_name": "log"
}
],
"file":... | {
"body": "@VisibleForTesting\n static void registerTimestampForTracking(\n Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) {\n metricsManager.registerMetric(\n TimestampTracker.class,\n shortName,\n TrackerUtils.... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_812 | {
"fields": [
{
"declarator": "MESSAGE = \"a exception\"",
"modifier": "private static final",
"original_string": "private static final String MESSAGE = \"a exception\";",
"type": "String",
"var_name": "MESSAGE"
},
{
"declarator": "CAUSE = new Exception()",
"modif... | {
"body": "@Test\n public void connectionExceptionsWithSufficientAttemptsShouldBlacklistConservative() {\n for (Exception ex : CONNECTION_EXCEPTIONS) {\n assertFalse(\"MAX_RETRIES_PER_HOST - 1 attempts should not blacklist\",\n handlerConservative.shouldBlacklist(ex, MAX_RETRIE... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraRequestExceptionHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraRequestExceptionHandler.class);",
"type": "Logger",
"var_n... | {
"body": "@VisibleForTesting\n boolean shouldBlacklist(Exception ex, int numberOfAttempts) {\n return isConnectionException(ex)\n && numberOfAttempts >= maxTriesSameHost.get()\n && !isExceptionNotImplicatingThisParticularNode(ex);\n }",
"class_method_signature": "Cassandr... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_957 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "USER_AGENT_NAME = \"user-agent\"",
"m... | {
"body": "@Test\n public void timeLockMigrationReportsReadyIfMigrationDone() {\n when(migrator.isInitialized()).thenReturn(true);\n when(lockAndTimestampServices.migrator()).thenReturn(Optional.of(migrator));\n\n assertTrue(TransactionManagers.timeLockMigrationCompleteIfNeeded(lockAndTimestam... | {
"fields": [
{
"declarator": "LOGGING_INTERVAL = 60",
"modifier": "private static final",
"original_string": "private static final int LOGGING_INTERVAL = 60;",
"type": "int",
"var_name": "LOGGING_INTERVAL"
},
{
"declarator": "log = LoggerFactory.getLogger(TransactionMa... | {
"body": "@VisibleForTesting\n static boolean timeLockMigrationCompleteIfNeeded(LockAndTimestampServices lockAndTimestampServices) {\n return lockAndTimestampServices.migrator().map(AsyncInitializer::isInitialized).orElse(true);\n }",
"class_method_signature": "TransactionManagers.timeLockMigrationCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_404 | {
"fields": [
{
"declarator": "RECOMPUTE_MILLIS = 10",
"modifier": "private static final",
"original_string": "private static final long RECOMPUTE_MILLIS = 10;",
"type": "long",
"var_name": "RECOMPUTE_MILLIS"
},
{
"declarator": "METRICS_CONFIGURATION\n = Targ... | {
"body": "@Test\n public void numberOfTombstonesDoesNotClashAcrossStrategies() {\n metrics.updateNumberOfTombstones(CONS_ONE, 1);\n metrics.updateNumberOfTombstones(THOR_ZERO, 10);\n metrics.updateNumberOfTombstones(CONS_TWO, 2);\n\n assertThat(metricsManager).hasTombstonesPutConservat... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweepMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweepMetrics.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public void updateNumberOfTombstones(ShardAndStrategy shardStrategy, long tombstones) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateNumberOfTombstones(tombstones));\n }",
"class_method_signature": "TargetedSweepMetrics.updateNumberOfTombstones(ShardAndStrategy shardStrategy... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_280 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "TABL... | {
"body": "@Test\n public void getTraceLogPresentOnTraceLevelEvenIfQueryIsSlow() {\n Appender mockAppender = setLogLevelAndGetAppender(Level.TRACE);\n\n doAnswer(waitASecondAndAHalfAndReturn).when(delegate).get(TABLE_REF, timestampByCell);\n kvs.get(TABLE_REF, timestampByCell);\n\n veri... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final KeyValueService delegate;",
"type": "KeyValueService",
"var_name": "delegate"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/ProfilingKeyVal... | {
"body": "@Override\n public Map<Cell, Value> get(TableReference tableRef, Map<Cell, Long> timestampByCell) {\n long startTime = System.currentTimeMillis();\n return KvsProfilingLogger.maybeLog(() -> delegate.get(tableRef, timestampByCell),\n (logger, stopwatch) ->\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_795 | {
"fields": [
{
"declarator": "ec2SnitchSupplier = () -> \"org.apache.cassandra.locator.Ec2Snitch\"",
"modifier": "private static final",
"original_string": "private static final Supplier<String> ec2SnitchSupplier = () -> \"org.apache.cassandra.locator.Ec2Snitch\";",
"type": "Supplier<Stri... | {
"body": "@Test\n public void shouldReturnOverrideLocation() {\n Optional<HostLocation> overrideLocation = Optional.of(HostLocation.of(\"dc1\", \"rack1\"));\n\n Supplier<Optional<HostLocation>> hostLocationSupplier = new HostLocationSupplier(ec2SnitchSupplier,\n ec2LocationSupplier, o... | {
"fields": [
{
"declarator": "snitchSupplier",
"modifier": "private final",
"original_string": "private final Supplier<String> snitchSupplier;",
"type": "Supplier<String>",
"var_name": "snitchSupplier"
},
{
"declarator": "ec2Supplier",
"modifier": "private final"... | {
"body": "@Override\n public Optional<HostLocation> get() {\n try {\n if (overrideLocation.isPresent()) {\n return overrideLocation;\n }\n\n String snitch = snitchSupplier.get();\n log.debug(\"Snitch successfully detected\", SafeArg.of(\"snitch\", ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_845 | {
"fields": [
{
"declarator": "MAX_TIMESTAMPS = 10_000",
"modifier": "private static final",
"original_string": "private static final int MAX_TIMESTAMPS = 10_000;",
"type": "int",
"var_name": "MAX_TIMESTAMPS"
},
{
"declarator": "unbatchedDelegate = new MaxTimestampsToGi... | {
"body": "@Test\n public void handsOutMaximumNumberOfTimestampsIfLimited() {\n assertThat(requestBatches(1, 20_000, 3))\n .containsExactly(single(1), range(10_001, 20_001), range(20_001, 20_004));\n verify(unbatchedDelegate).getFreshTimestamps(20_004);\n verify(unbatchedDelegat... | {
"fields": [
{
"declarator": "timer = LoggingOperationTimer.create(RequestBatchingTimestampService.class)",
"modifier": "private static final",
"original_string": "private static final OperationTimer timer = LoggingOperationTimer.create(RequestBatchingTimestampService.class);",
"type": "O... | {
"body": "@Override\n public TimestampRange getFreshTimestamps(int numTimestampsRequested) {\n Preconditions.checkArgument(numTimestampsRequested > 0, \"Must not request zero or negative timestamps\");\n ListenableFuture<TimestampRange> range = batcher.apply(numTimestampsRequested);\n try {\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_73 | {
"fields": [
{
"declarator": "CLIENT = Client.of(\"client\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT = Client.of(\"client\");",
"type": "Client",
"var_name": "CLIENT"
},
{
"declarator": "CLIENT_2 = Client.of(\"client... | {
"body": "@Test\n public void failureMechanismInvokedForRepeatedTimestampsInSameRound() {\n when(checker1.getFreshTimestampFromNodeForClient(CLIENT.value())).then(getNextTimestamp());\n when(checker2.getFreshTimestampFromNodeForClient(CLIENT.value()))\n .then(getNextTimestamp())\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(NoSimultaneousServiceCheck.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(NoSimultaneousServiceCheck.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "public void processHealthCheckDigest(HealthCheckDigest digest) {\n Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS);\n if (clientsWithMultipleLeaders.isEmpty()) {\n return;\n }\n\n log.info(\"Clients {} appear to ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_516 | {
"fields": [
{
"declarator": "SUCCESS_TOO_FAST = SweepIterationResults.success(1L)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_TOO_FAST = SweepIterationResults.success(1L);",
"type": "SweepIterationResult",
"var_name": ... | {
"body": "@Test\n public void iterationWithFullBatchReducesPause() {\n assertThat(delay.getNextPause(SUCCESS_TOO_SLOW)).isLessThan(INITIAL_DELAY);\n }",
"class_method_signature": "SweepDelayTest.iterationWithFullBatchReducesPause()",
"constructor": false,
"full_signature": "@Test public void itera... | {
"fields": [
{
"declarator": "BATCH_CELLS_LOW_THRESHOLD = 100",
"modifier": "static final",
"original_string": "static final int BATCH_CELLS_LOW_THRESHOLD = 100;",
"type": "int",
"var_name": "BATCH_CELLS_LOW_THRESHOLD"
},
{
"declarator": "MIN_PAUSE_MILLIS = 1",
"... | {
"body": "long getNextPause(SweepIterationResult result) {\n return SweepIterationResults.caseOf(result)\n .success(this::updateCurrentPauseAndGet)\n .unableToAcquireShard_(maxPauseMillis)\n .insufficientConsistency_(BACKOFF)\n .otherError_(maxPauseM... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_146 | {
"fields": [
{
"declarator": "CLIENT_A = \"a-client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT_A = \"a-client\";",
"type": "String",
"var_name": "CLIENT_A"
},
{
"declarator": "CLIENT_B = \"b-client\"",
"modifier... | {
"body": "@Test\n public void servicesAreOnlyCreatedOncePerClient() {\n namespaces.get(CLIENT_A);\n namespaces.get(CLIENT_A);\n\n verify(serviceFactory, times(1)).apply(any());\n }",
"class_method_signature": "TimelockNamespacesTest.servicesAreOnlyCreatedOncePerClient()",
"constructor"... | {
"fields": [
{
"declarator": "ACTIVE_CLIENTS = \"activeClients\"",
"modifier": "@VisibleForTesting static final",
"original_string": "@VisibleForTesting static final String ACTIVE_CLIENTS = \"activeClients\";",
"type": "String",
"var_name": "ACTIVE_CLIENTS"
},
{
"decla... | {
"body": "public TimeLockServices get(String namespace) {\n return services.computeIfAbsent(namespace, this::createNewClient);\n }",
"class_method_signature": "TimelockNamespaces.get(String namespace)",
"constructor": false,
"full_signature": "public TimeLockServices get(String namespace)",
"identi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_453 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void withManyEntriesSpawnOneTaskEachTimeCoolDownPasses() throws Exception {\n when(sweepIteration.call()).thenReturn(SUCCESS_LARGE);\n scheduler.start(1);\n\n tickClock();\n runSweepIterations(1 + 4);\n\n tickClockForHalfCoolDown();\n runSweepIter... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_900 | {
"fields": [
{
"declarator": "TOKEN_1 = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken TOKEN_1 = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "TOKEN_1"
},
{
"declarator": "... | {
"body": "@Test\n public void getImmutableTimestampDelegates() {\n long immutableTs = 789L;\n when(delegate.getImmutableTimestamp()).thenReturn(immutableTs);\n\n assertThat(timelock.getImmutableTimestamp()).isEqualTo(immutableTs);\n }",
"class_method_signature": "TimeLockClientTest.getIm... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public long getImmutableTimestamp() {\n return executeOnTimeLock(delegate::getImmutableTimestamp);\n }",
"class_method_signature": "TimeLockClient.getImmutableTimestamp()",
"constructor": false,
"full_signature": "@Override public long getImmutableTimestamp()",
"identifier"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_214 | {
"fields": [
{
"declarator": "NAME_METADATA_DESCRIPTION = NameMetadataDescription.create(\n ImmutableList.of(\n NameComponentDescription.of(\"age\", ValueType.FIXED_LONG),\n NameComponentDescription.of(\"name\", ValueType.STRING)))",
"modifier": "priva... | {
"body": "@Test\n public void testDeserializeRowFromJsonList() throws Exception {\n JsonNode jsonNode = new ObjectMapper().readTree(\"[68, \\\"Smeagol\\\"]\");\n byte[] row = AtlasDeserializers.deserializeRow(NAME_METADATA_DESCRIPTION, jsonNode);\n byte[] expectedRow = Bytes.concat(ValueType.... | {
"fields": [],
"file": "atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/AtlasDeserializers.java",
"identifier": "AtlasDeserializers",
"interfaces": "",
"methods": [
{
"class_method_signature": "AtlasDeserializers.AtlasDeserializers()",
"constructor": true,
"full_signature": "... | {
"body": "public static byte[] deserializeRow(NameMetadataDescription description,\n JsonNode node) {\n return deserializeRowish(description, node, true);\n }",
"class_method_signature": "AtlasDeserializers.deserializeRow(NameMetadataDescription description,\n JsonNode node)",
"co... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_644 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 10L",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 10L;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 20L",
"modifier": "private static ... | {
"body": "@Test\n public void returnsGreatestPunchedTimeBeforeTimestampEvenIfNotAssociatedWithGreatestEligibleTimestamp() {\n puncherStore = initializePuncherStore(PUNCHER_HISTORY_WITH_CLOCK_DRIFT);\n assertThat(puncherStore.getMillisForTimestamp(TIMESTAMP_2))\n .isEqualTo(WALL_CLOCK_... | {
"fields": [
{
"declarator": "COLUMN = \"t\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] COLUMN = \"t\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_name": "COLUMN"
},
{
"declarato... | {
"body": "@Override\n public long getMillisForTimestamp(long timestamp) {\n return getMillisForTimestamp(keyValueService, timestamp);\n }",
"class_method_signature": "KeyValueServicePuncherStore.getMillisForTimestamp(long timestamp)",
"constructor": false,
"full_signature": "@Override public long ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_351 | {
"fields": [
{
"declarator": "DATA_SIZE = 4",
"modifier": "private static final",
"original_string": "private static final int DATA_SIZE = 4;",
"type": "int",
"var_name": "DATA_SIZE"
},
{
"declarator": "DATA_SIZE_PLUS_ONE = 5",
"modifier": "private static final",... | {
"body": "@Test\n public void canReadBlock() throws IOException {\n byte[] result = new byte[DATA_SIZE];\n int read = dataStream.read(result);\n assertEquals(DATA_SIZE, read);\n assertArrayEquals(data, result);\n }",
"class_method_signature": "BlockConsumingInputStreamTest.canRead... | {
"fields": [
{
"declarator": "blockGetter",
"modifier": "private final",
"original_string": "private final BlockGetter blockGetter;",
"type": "BlockGetter",
"var_name": "blockGetter"
},
{
"declarator": "numBlocks",
"modifier": "private final",
"original_str... | {
"body": "@Override\n public int read() throws IOException {\n if (positionInBuffer < buffer.length) {\n return buffer[positionInBuffer++] & 0xff;\n }\n\n if (nextBlockToRead < numBlocks) {\n boolean reloaded = refillBuffer();\n if (!reloaded) {\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_701 | {
"fields": [
{
"declarator": "DO_NOTHING = () -> {}",
"modifier": "private static final",
"original_string": "private static final Runnable DO_NOTHING = () -> {};",
"type": "Runnable",
"var_name": "DO_NOTHING"
},
{
"declarator": "RETURN_ONE = () -> 1",
"modifier"... | {
"body": "@Test\n public void passesCallThroughExecute() throws CheckedRejectedExecutionException {\n checkedRejectionExecutor.execute(DO_NOTHING);\n verify(delegate, times(1)).execute(DO_NOTHING);\n }",
"class_method_signature": "CheckedRejectionExecutorServiceTest.passesCallThroughExecute()",... | {
"fields": [
{
"declarator": "underlying",
"modifier": "private final",
"original_string": "private final ExecutorService underlying;",
"type": "ExecutorService",
"var_name": "underlying"
}
],
"file": "atlasdb-commons/src/main/java/com/palantir/common/concurrent/CheckedRejec... | {
"body": "public void execute(Runnable runnable) throws CheckedRejectedExecutionException {\n try {\n underlying.execute(runnable);\n } catch (RejectedExecutionException ex) {\n throw new CheckedRejectedExecutionException(ex);\n }\n }",
"class_method_signature": "Check... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_428 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void thorough_getTimestampsToSweep_oneSentinel_returnsIt() {\n List<CandidateCellForSweeping> candidate = ImmutableList.of(\n ImmutableCandidateCellForSweeping.builder()\n .cell(SINGLE_CELL)\n .sortedTimestamps(ImmutableL... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_582 | {
"fields": [
{
"declarator": "ENCODING_STRATEGY = V1EncodingStrategy.INSTANCE",
"modifier": "private static final",
"original_string": "private static final V1EncodingStrategy ENCODING_STRATEGY = V1EncodingStrategy.INSTANCE;",
"type": "V1EncodingStrategy",
"var_name": "ENCODING_STRA... | {
"body": "@Test\n public void batchesElementsAndDelegates() {\n WriteBatchingTransactionService.processBatch(mockTransactionService, ImmutableList.of(\n TestTransactionBatchElement.of(1L, 100L),\n TestTransactionBatchElement.of(2L, 200L),\n TestTransactionBatchE... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(WriteBatchingTransactionService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(WriteBatchingTransactionService.class);",
"type": "Logger",
"var_nam... | {
"body": "@VisibleForTesting\n static void processBatch(\n EncodingTransactionService delegate, List<BatchElement<TimestampPair, Void>> batchElements) {\n Multimap<Long, BatchElement<TimestampPair, Void>> startTimestampKeyedBatchElements\n = MultimapBuilder.hashKeys().hashSetValue... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_994 | {
"fields": [
{
"declarator": "COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\")",
"modifier": "private static final",
"original_string": "private static final byte[] COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\");",
"type": "byte[]",
"var_name": "COORDINATION_ROW"
},
{
"dec... | {
"body": "@Test\n public void throwsIfAttemptingToGetAtNegativeSequenceNumber() {\n assertThatThrownBy(() -> coordinationStore.getValue(-1))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Only positive sequence numbers are supported\");\n }",
"clas... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class);",
"type": "Logger",
"var_n... | {
"body": "@VisibleForTesting\n Optional<T> getValue(long sequenceNumber) {\n Preconditions.checkState(\n sequenceNumber > 0,\n \"Only positive sequence numbers are supported, but found %s\",\n sequenceNumber);\n return readFromCoordinationTable(getCellFor... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_613 | {
"fields": [
{
"declarator": "FIVE = 5L",
"modifier": "private static final",
"original_string": "private static final long FIVE = 5L;",
"type": "long",
"var_name": "FIVE"
},
{
"declarator": "value = new AtomicLong(0)",
"modifier": "private final",
"origina... | {
"body": "@Test\n public void reportsDifferencesBetweenValues() {\n value.set(FIVE);\n longGauge.getValue();\n value.addAndGet(FIVE);\n assertThat(value.get()).isEqualTo(FIVE + FIVE);\n assertThat(longGauge.getValue()).isEqualTo(FIVE);\n }",
"class_method_signature": "ZeroB... | {
"fields": [
{
"declarator": "underlying",
"modifier": "private final",
"original_string": "private final LongSupplier underlying;",
"type": "LongSupplier",
"var_name": "underlying"
},
{
"declarator": "previousValue = 0",
"modifier": "private",
"original_st... | {
"body": "@Override\n public synchronized Long getValue() {\n long currentValue = underlying.getAsLong();\n long previous = previousValue;\n previousValue = currentValue;\n return currentValue - previous;\n }",
"class_method_signature": "ZeroBasedDeltaGauge.getValue()",
"constru... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.