id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
62117812_108 | {
"fields": [
{
"declarator": "executorService = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executorService = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executorService"
... | {
"body": "@Test(invocationTimeOut = 500)\n public void testCorrectBackoffConfiguration() {\n final Backoff backoff = consumer.getConnectionHandler().backoff;\n ClientConfigurationData clientConfigurationData = new ClientConfigurationData();\n Assert.assertEquals(backoff.getMax(), TimeUnit.NAN... | {
"fields": [
{
"declarator": "MAX_REDELIVER_UNACKNOWLEDGED = 1000",
"modifier": "private static final",
"original_string": "private static final int MAX_REDELIVER_UNACKNOWLEDGED = 1000;",
"type": "int",
"var_name": "MAX_REDELIVER_UNACKNOWLEDGED"
},
{
"declarator": "con... | {
"body": "public ConnectionHandler getConnectionHandler() {\n return connectionHandler;\n }",
"class_method_signature": "ConsumerImpl.getConnectionHandler()",
"constructor": false,
"full_signature": "public ConnectionHandler getConnectionHandler()",
"identifier": "getConnectionHandler",
"invocati... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_22 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testProducerBuilderImplWhenSendTimeoutPropertyIsNegative() {\n producerBuilderImpl.sendTimeout(-1, TimeUnit.SECONDS);\n }",
"class_method_signature": "ProducerBuilderImplTest.testProducerBuilderImplWhenSendTimeoutProper... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private P... | {
"body": "@Override\n public ProducerBuilder<T> sendTimeout(int sendTimeout, @NonNull TimeUnit unit) {\n conf.setSendTimeoutMs(sendTimeout, unit);\n return this;\n }",
"class_method_signature": "ProducerBuilderImpl.sendTimeout(int sendTimeout, @NonNull TimeUnit unit)",
"constructor": false,
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_364 | {
"fields": [
{
"declarator": "log = Logger.get(TestPulsarMetadata.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(TestPulsarMetadata.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "pulsar-sql/presto-pu... | {
"body": "@Test(dataProvider = \"rewriteNamespaceDelimiter\", singleThreaded = true)\n public void testGetTableMetadataTableBlankSchema(String delimiter) throws PulsarAdminException {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n SchemaInfo badSchemaInfo = new SchemaInfo();\n badSch... | {
"fields": [
{
"declarator": "connectorId",
"modifier": "private final",
"original_string": "private final String connectorId;",
"type": "String",
"var_name": "connectorId"
},
{
"declarator": "pulsarAdmin",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) {\n ConnectorTableMetadata connectorTableMetadata;\n SchemaTableName schemaTableName = convertTableHandle(table).toSchemaTableName();\n connectorTableMetadata = getTableM... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_221 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test\n public void testMergeRuntimeFlags() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newFunctionConfig = createUpdatedSourceConfig(\"runtimeFlags\", \"-Dfoo=bar2\");\n SourceConfig mergedConfig = SourceConfigUtils.validateUpdate(sourceConfig, newFunctionC... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java",
"identifier": "SourceConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SourceConfigUtils.convert(SourceConfig sourceConfig, ExtractedSourceDetails sourceDe... | {
"body": "public static SourceConfig validateUpdate(SourceConfig existingConfig, SourceConfig newConfig) {\n SourceConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants diffe... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_256 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFunctionConfigConvertFromDetails() {\n String name = \"test1\";\n String namespace = \"ns1\";\n String tenant = \"tenant1\";\n String classname = getClass().getName();\n int parallelism = 3;\n Map<String, String> userConfig = new HashMap<... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig convertFromDetails(FunctionDetails functionDetails) {\n FunctionConfig functionConfig = new FunctionConfig();\n functionConfig.setTenant(functionDetails.getTenant());\n functionConfig.setNamespace(functionDetails.getNamespace());\n functionConfig.set... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_313 | {
"fields": [
{
"declarator": "LOCALHOST = \"127.0.0.1\"",
"modifier": "private static final",
"original_string": "private static final String LOCALHOST = \"127.0.0.1\";",
"type": "String",
"var_name": "LOCALHOST"
},
{
"declarator": "TCP = \"tcp\"",
"modifier": "p... | {
"body": "@Test\n public void testNettyTcpConfigLoadWithMap() throws IOException {\n Map<String, Object> map = new HashMap<>();\n map.put(\"type\", TCP);\n map.put(\"host\", LOCALHOST);\n map.put(\"port\", 10999);\n map.put(\"numberOfThreads\", 1);\n\n NettySourceConfig n... | {
"fields": [
{
"declarator": "serialVersionUID = -7116130435021510496L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7116130435021510496L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "typ... | {
"body": "public static NettySourceConfig load(Map<String, Object> map) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n return mapper.readValue(new ObjectMapper().writeValueAsString(map), NettySourceConfig.class);\n }",
"class_method_signature": "NettySourceConfig.load(Map<Strin... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_55 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "consumerBuilderImpl",
... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testConsumerBuilderImplWhenTopicNamesVarargsIsNull() {\n consumerBuilderImpl.topic(null);\n }",
"class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenTopicNamesVarargsIsNull()",
"constructor": ... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private C... | {
"body": "@Override\n public ConsumerBuilder<T> topic(String... topicNames) {\n checkArgument(topicNames != null && topicNames.length > 0,\n \"Passed in topicNames should not be null or empty.\");\n Arrays.stream(topicNames).forEach(topicName ->\n checkArgument(StringUt... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_190 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Bad config passed to TestTriggerer\")\n public void testWithoutRightTriggererConfig() throws Exception {\n Map<String, Object> badConfig = new HashMap<>();\n badConfig.put(\"something\", \"else\");\n te... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_485 | {
"fields": [
{
"declarator": "compactionScheduler",
"modifier": "private",
"original_string": "private ScheduledExecutorService compactionScheduler;",
"type": "ScheduledExecutorService",
"var_name": "compactionScheduler"
}
],
"file": "pulsar-broker/src/test/java/org/apache/p... | {
"body": "@Test\n public void testCompactEmptyTopic() throws Exception {\n String topic = \"persistent://my-property/use/my-ns/my-topic1\";\n\n // trigger creation of topic on server side\n pulsarClient.newConsumer().topic(topic).subscriptionName(\"sub1\").subscribe().close();\n\n Book... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Compactor.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(Compactor.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "... | {
"body": "public CompletableFuture<Long> compact(String topic) {\n return RawReader.create(pulsar, topic, COMPACTION_SUBSCRIPTION).thenComposeAsync(\n this::compactAndCloseReader, scheduler);\n }",
"class_method_signature": "Compactor.compact(String topic)",
"constructor": false,
"full... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_6 | {
"fields": [],
"file": "pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java",
"identifier": "PulsarKafkaProducerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPulsarKafkaProducer() {\n ClientBuilder mockClientBuilder = mock(ClientBuilder.class);\n ProducerBuilder mockProducerBuilder = mock(ProducerBuilder.class);\n doAnswer(invocation -> {\n Assert.assertEquals((int)invocation.getArguments()[0], 1000000,... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClient client;",
"type": "PulsarClient",
"var_name": "client"
},
{
"declarator": "pulsarProducerBuilder",
"modifier": "private final",
"original_stri... | {
"body": "public PulsarKafkaProducer(Map<String, Object> configs) {\n this(new ProducerConfig(configs), null, null);\n }",
"class_method_signature": "PulsarKafkaProducer.PulsarKafkaProducer(Map<String, Object> configs)",
"constructor": true,
"full_signature": "public PulsarKafkaProducer(Map<String, ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_201 | {
"fields": [
{
"declarator": "consumerConfigs = new HashMap<>()",
"modifier": "private static",
"original_string": "private static Map<String, ConsumerConfig> consumerConfigs = new HashMap<>();",
"type": "Map<String, ConsumerConfig>",
"var_name": "consumerConfigs"
},
{
... | {
"body": "@Test\n public void testComplexOuputType() throws Exception {\n PulsarSourceConfig pulsarConfig = getPulsarConfigs(false);\n // set type to void\n pulsarConfig.setTypeClassName(ComplexUserDefinedType.class.getName());\n consumerConfigs.put(\"persistent://sample/ns1/test_resul... | {
"fields": [
{
"declarator": "pulsarClient",
"modifier": "private final",
"original_string": "private final PulsarClient pulsarClient;",
"type": "PulsarClient",
"var_name": "pulsarClient"
},
{
"declarator": "pulsarSourceConfig",
"modifier": "private final",
... | {
"body": "@SuppressWarnings(\"unchecked\")\n @VisibleForTesting\n Map<String, ConsumerConfig<T>> setupConsumerConfigs() throws ClassNotFoundException {\n Map<String, ConsumerConfig<T>> configs = new TreeMap<>();\n\n Class<?> typeArg = Reflections.loadClass(this.pulsarSourceConfig.getTypeClassName... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_344 | {
"fields": [],
"file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java",
"identifier": "TestAbstractConfigurationProvider",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDispoableChannel() throws Exception {\n String agentName = \"agent1\";\n Map<String, String> properties = getPropertiesForChannel(agentName,\n DisposableChannel.class.getName());\n MemoryConfigurationProvider provider =\n new Mem... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);",
"type": "Logger",
"var_n... | {
"body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_597 | {
"fields": [],
"file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/MetaStoreImplTest.java",
"identifier": "MetaStoreImplTest",
"interfaces": "",
"superclass": "extends MockedBookKeeperTestCase"
} | {
"body": "@Test(timeOut = 20000)\n void failInCreatingMLnode() throws Exception {\n MetaStore store = new MetaStoreImpl(new ZKMetadataStore(zkc), executor);\n\n final CompletableFuture<Void> promise = new CompletableFuture<>();\n\n zkc.failConditional(Code.CONNECTIONLOSS, (op, path) -> {\n ... | {
"fields": [
{
"declarator": "BASE_NODE = \"/managed-ledgers\"",
"modifier": "private static final",
"original_string": "private static final String BASE_NODE = \"/managed-ledgers\";",
"type": "String",
"var_name": "BASE_NODE"
},
{
"declarator": "PREFIX = BASE_NODE + \... | {
"body": "@Override\n public void getManagedLedgerInfo(String ledgerName, boolean createIfMissing,\n MetaStoreCallback<ManagedLedgerInfo> callback) {\n // Try to get the content or create an empty node\n String path = PREFIX + ledgerName;\n store.get(path)\n .thenAcc... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_578 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/impl/MinAvailablePolicyTest.java",
"identifier": "MinAvailablePolicyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMinAvailablePolicty() {\n MinAvailablePolicy m = new MinAvailablePolicy(3, 10);\n assertNotEquals(new OldPolicies(), m);\n assertFalse(m.shouldFailoverToSecondary(15));\n assertTrue(m.shouldFailoverToSecondary(2));\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "MIN_LIMIT_KEY = \"min_limit\"",
"modifier": "private static final",
"original_string": "private static final String MIN_LIMIT_KEY = \"min_limit\";",
"type": "String",
"var_name": "MIN_LIMIT_KEY"
},
{
"declarator": "USAGE_THRESHOLD_KEY = \"... | {
"body": "@Override\n public boolean shouldFailoverToSecondary(SortedSet<BrokerStatus> primaryCandidates) {\n int numAvailablePrimaryBrokers = 0;\n for (BrokerStatus brkStatus : primaryCandidates) {\n if (isBrokerAvailable(brkStatus)) {\n numAvailablePrimaryBrokers++;\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_128 | {
"fields": [
{
"declarator": "testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"})",
"modifier": "private final",
"original_string": "private final List<String> testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"});",
"type": "List<String>",
"var_name": "testStrin... | {
"body": "@Test\n public void testCustomString() {\n TestConfig testConfig = createGoodConfig();\n testConfig.customString = \"http://google.com\";\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage... | {
"fields": [
{
"declarator": "DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class",
"modifier": "private static final",
"original_string": "private static final Class DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class;",
"type": "Class",
"var_name": "DEFAULT_ANNOT... | {
"body": "public static void validateConfig(Object config, Class annotationClass) {\n for (Field field : config.getClass().getDeclaredFields()) {\n Object value = null;\n field.setAccessible(true);\n try {\n value = field.get(config);\n } catch (Illeg... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_217 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test\n public void testMergeDifferentUserConfig() {\n SourceConfig sourceConfig = createSourceConfig();\n Map<String, String> myConfig = new HashMap<>();\n myConfig.put(\"MyKey\", \"MyValue\");\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"configs\", myConfig)... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java",
"identifier": "SourceConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SourceConfigUtils.convert(SourceConfig sourceConfig, ExtractedSourceDetails sourceDe... | {
"body": "public static SourceConfig validateUpdate(SourceConfig existingConfig, SourceConfig newConfig) {\n SourceConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants diffe... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_352 | {
"fields": [],
"file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java",
"identifier": "TestAbstractConfigurationProvider",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSinkSourceMismatchDuringConfiguration() throws Exception {\n String agentName = \"agent1\";\n String sourceType = \"seq\";\n String channelType = \"memory\";\n String sinkType = \"avro\";\n Map<String, String> properties = getProperties(agentNam... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);",
"type": "Logger",
"var_n... | {
"body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_14 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BackoffTest.java",
"identifier": "BackoffTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldBackoffTest() {\n // gives false\n assertFalse(Backoff.shouldBackoff(0L, TimeUnit.NANOSECONDS, 0));\n long currentTimestamp = System.nanoTime();\n // gives true\n assertTrue(Backoff.shouldBackoff(currentTimestamp, TimeUnit.NANOSECONDS, 100));\... | {
"fields": [
{
"declarator": "DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100)",
"modifier": "public static final",
"original_string": "public static final long DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100);",
"type": "long",
"var_name": "D... | {
"body": "public static boolean shouldBackoff(long initialTimestamp, TimeUnit unitInitial, int failedAttempts,\n \t\t\t\t\t\t\t\t\tlong defaultInterval, long maxBackoffInterval) {\n \tlong initialTimestampInNano = unitInitial.toNanos(initialTimestamp);\n long currentTime = System.nanoTime();\n lo... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_581 | {
"fields": [
{
"declarator": "defaultJson = \"{\\\"policy1\\\":{\\\"namespaces\\\":[\\\"pulsar/use/test.*\\\"],\\\"primary\\\":[\\\"prod1-broker[1-3].messaging.use.example.com\\\"],\\\"secondary\\\":[\\\"prod1-broker.*.use.example.com\\\"],\\\"auto_failover_policy\\\":{\\\"policy_type\\\":\\\"min_available... | {
"body": "@Test\n public void testSetPolicy() throws Exception {\n NamespaceIsolationPolicies policies = this.getDefaultTestPolicies();\n // set a new policy\n String newPolicyJson = \"{\\\"namespaces\\\":[\\\"pulsar/use/TESTNS.*\\\"],\\\"primary\\\":[\\\"prod1-broker[45].messaging.use.exampl... | {
"fields": [
{
"declarator": "policies = null",
"modifier": "private",
"original_string": "private Map<String, NamespaceIsolationData> policies = null;",
"type": "Map<String, NamespaceIsolationData>",
"var_name": "policies"
}
],
"file": "pulsar-common/src/main/java/org/apach... | {
"body": "public void setPolicy(String policyName, NamespaceIsolationData policyData) {\n policyData.validate();\n policies.put(policyName, policyData);\n }",
"class_method_signature": "NamespaceIsolationPolicies.setPolicy(String policyName, NamespaceIsolationData policyData)",
"constructor": fa... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_240 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeCleanupSubscription() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"cleanupSubscription\", true);\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(function... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_305 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class);",
"type": "Logger",
... | {
"body": "@Test\n public void testGcsSmallBlockSizeConfigured() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"google-cloud-storage\");\n File tmpKeyFile = File.createTempFile(\"gcsOffload\", \"json\");\n conf.setGcsManagedLedg... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);",
"type": "Logger",
"var_nam... | {
"body": "@VisibleForTesting\n static BlobStoreManagedLedgerOffloader create(OffloadPolicies conf,\n OrderedScheduler scheduler) throws IOException {\n return create(conf, Maps.newHashMap(), scheduler);\n }",
"class_method_signature": "BlobStoreManagedL... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_186 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Batch Configs cannot be found\")\n public void testWithoutRightConfig() throws Exception {\n config.clear();\n batchSourceExecutor.open(config, context);\n }",
"class_method_signature": "BatchSourceExec... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_43 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplTest.java",
"identifier": "BatchMessageIdImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hashCodeTest() {\n BatchMessageIdImpl batchMsgId1 = new BatchMessageIdImpl(0, 0, 0, 0);\n BatchMessageIdImpl batchMsgId2 = new BatchMessageIdImpl(1, 1, 1, 1);\n\n assertEquals(batchMsgId1.hashCode(), batchMsgId1.hashCode());\n assertTrue(batchMsgId1.hashCo... | {
"fields": [
{
"declarator": "NO_BATCH = -1",
"modifier": "private final static",
"original_string": "private final static int NO_BATCH = -1;",
"type": "int",
"var_name": "NO_BATCH"
},
{
"declarator": "batchIndex",
"modifier": "private final",
"original_str... | {
"body": "@Override\n public int hashCode() {\n return (int) (31 * (ledgerId + 31 * entryId) + (31 * partitionIndex) + batchIndex);\n }",
"class_method_signature": "BatchMessageIdImpl.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode"... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_539 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/GrowableArrayBlockingQueueTest.java",
"identifier": "GrowableArrayBlockingQueueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void removeTest() throws Exception {\n BlockingQueue<Integer> queue = new GrowableArrayBlockingQueue<>(4);\n\n assertNull(queue.poll());\n\n assertTrue(queue.offer(1));\n assertTrue(queue.offer(2));\n assertTrue(queue.offer(3));\n\n assertEquals(q... | {
"fields": [
{
"declarator": "headLock = new ReentrantLock()",
"modifier": "private final",
"original_string": "private final ReentrantLock headLock = new ReentrantLock();",
"type": "ReentrantLock",
"var_name": "headLock"
},
{
"declarator": "headIndex = new PaddedInt()... | {
"body": "@Override\n public T remove() {\n T item = poll();\n if (item == null) {\n throw new NoSuchElementException();\n }\n\n return item;\n }",
"class_method_signature": "GrowableArrayBlockingQueue.remove()",
"constructor": false,
"full_signature": "@Override pu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_169 | {
"fields": [
{
"declarator": "mockTable",
"modifier": "private",
"original_string": "private Table<ByteBuf, ByteBuf> mockTable;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "mockTable"
},
{
"declarator": "stateContext",
"modifier": "private",
"original_... | {
"body": "@Test\n public void testGetKeyNotPresent() throws Exception {\n when(mockTable.get(any(ByteBuf.class)))\n .thenReturn(FutureUtils.value(null));\n CompletableFuture<ByteBuffer> result = stateContext.get(\"test-key\");\n assertTrue(result != null);\n assertEquals... | {
"fields": [
{
"declarator": "table",
"modifier": "private final",
"original_string": "private final Table<ByteBuf, ByteBuf> table;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "table"
}
],
"file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/inst... | {
"body": "@Override\n public CompletableFuture<ByteBuffer> get(String key) {\n return table.get(Unpooled.wrappedBuffer(key.getBytes(UTF_8))).thenApply(\n data -> {\n try {\n if (data != null) {\n ByteBuffer result = ByteBuf... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_493 | {
"fields": [],
"file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/AvroSerializationSchemaTest.java",
"identifier": "AvroSerializationSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAvroSerializationSchemaWithSuccessfulCase() throws IOException {\n NasaMission nasaMission = NasaMission.newBuilder().setId(1).setName(\"Mercury program\").setStartYear(1959).setEndYear(1963).build();\n AvroSerializationSchema schema = new AvroSerializationSchema();... | {
"fields": [
{
"declarator": "serialVersionUID = -6691140169413760919L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -6691140169413760919L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "pulsar-flink/sr... | {
"body": "@Override\n public byte[] serialize(T t) {\n if (null == t) {\n return null;\n }\n\n // Writer to serialize Avro record into a byte array.\n DatumWriter<T> writer = new SpecificDatumWriter<>(t.getSchema());\n // Output stream to serialize records into byte a... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_391 | {
"fields": [],
"file": "pulsar-broker-common/src/test/java/org/apache/pulsar/broker/validator/MultipleListenerValidatorTest.java",
"identifier": "MultipleListenerValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testListenerDuplicate_1() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setAdvertisedListeners(\" internal:pulsar://127.0.0.1:6660, internal:pulsar+ssl://127.0.0.1:6651,\"\n + \... | {
"fields": [],
"file": "pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java",
"identifier": "MultipleListenerValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "MultipleListenerValidator.validateAndAnalysisAdvertisedListener(Servi... | {
"body": "public static Map<String, AdvertisedListener> validateAndAnalysisAdvertisedListener(ServiceConfiguration config) {\n if (StringUtils.isNotBlank(config.getAdvertisedListeners()) && StringUtils.isNotBlank(config.getAdvertisedAddress())) {\n throw new IllegalArgumentException(\"`advertisedLi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_542 | {
"fields": [
{
"declarator": "Iterations = 1",
"modifier": "final static",
"original_string": "final static int Iterations = 1;",
"type": "int",
"var_name": "Iterations"
},
{
"declarator": "ReadIterations = 1000",
"modifier": "final static",
"original_strin... | {
"body": "@Test\n public void testPutIfAbsent() {\n ConcurrentOpenHashMap<Long, String> map = new ConcurrentOpenHashMap<>();\n assertNull(map.putIfAbsent(1l, \"one\"));\n assertEquals(map.get(1l), \"one\");\n\n assertEquals(map.putIfAbsent(1l, \"uno\"), \"one\");\n assertEquals(... | {
"fields": [
{
"declarator": "EmptyKey = null",
"modifier": "private static final",
"original_string": "private static final Object EmptyKey = null;",
"type": "Object",
"var_name": "EmptyKey"
},
{
"declarator": "DeletedKey = new Object()",
"modifier": "private st... | {
"body": "public V putIfAbsent(K key, V value) {\n checkNotNull(key);\n checkNotNull(value);\n long h = hash(key);\n return getSection(h).put(key, value, (int) h, true, null);\n }",
"class_method_signature": "ConcurrentOpenHashMap.putIfAbsent(K key, V value)",
"constructor": false,... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_112 | {
"fields": [
{
"declarator": "resolver",
"modifier": "private",
"original_string": "private PulsarServiceNameResolver resolver;",
"type": "PulsarServiceNameResolver",
"var_name": "resolver"
}
],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/PulsarService... | {
"body": "@Test(expectedExceptions = IllegalStateException.class)\n public void testResolveBeforeUpdateServiceUrl() {\n resolver.resolveHost();\n }",
"class_method_signature": "PulsarServiceNameResolverTest.testResolveBeforeUpdateServiceUrl()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "serviceUri",
"modifier": "private volatile",
"original_string": "private volatile ServiceURI serviceUri;",
"type": "ServiceURI",
"var_name": "serviceUri"
},
{
"declarator": "serviceUrl",
"modifier": "private volatile",
"origina... | {
"body": "@Override\n public InetSocketAddress resolveHost() {\n List<InetSocketAddress> list = addressList;\n checkState(\n list != null, \"No service url is provided yet\");\n checkState(\n !list.isEmpty(), \"No hosts found for service url : \" + serviceUrl);\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_407 | {
"fields": [
{
"declarator": "TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\"",
"modifier": "private final static",
"original_string": "private final static String TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\";",
"type": "String",
... | {
"body": "@Test\n public void testClientServerConnectionTls() throws Exception {\n addBrokerToZk(2);\n\n final CompletableFuture<BaseCommand> promise = new CompletableFuture<>();\n NioEventLoopGroup workerGroup = connectToService(service.getServiceUrlTls(), promise, true);\n assertEqua... | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final ServiceConfig config;",
"type": "ServiceConfig",
"var_name": "config"
},
{
"declarator": "serviceUrl",
"modifier": "private",
"original_string": "private S... | {
"body": "public String getServiceUrlTls() {\n return serviceUrlTls;\n }",
"class_method_signature": "DiscoveryService.getServiceUrlTls()",
"constructor": false,
"full_signature": "public String getServiceUrlTls()",
"identifier": "getServiceUrlTls",
"invocations": [],
"modifiers": "public",
"... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_38 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test\n public void testSinglePartitionMessageRouterImplInstance() throws NoSuchFieldException, IllegalAccessException {\n ProducerConfigurationData producerConfigurationData = new ProducerConfigurationData();\n producerConfigurationData.setMessageRoutingMode(MessageRoutingMode.SingleParti... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PartitionedProducerImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PartitionedProducerImpl.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "private MessageRouter getMessageRouter() {\n MessageRouter messageRouter;\n\n MessageRoutingMode messageRouteMode = conf.getMessageRoutingMode();\n\n switch (messageRouteMode) {\n case CustomPartition:\n messageRouter = checkNotNull(conf.getCustomMessageRouter... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_283 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java... | {
"body": "@Test\n public void testMergeDifferentParallelism() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"parallelism\", 101);\n SinkConfig mergedConfig = SinkConfigUtils.validateUpdate(sinkConfig, newSinkConfig);\n assertEqual... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java",
"identifier": "SinkConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SinkConfigUtils.convert(SinkConfig sinkConfig, ExtractedSinkDetails sinkDetails)",
... | {
"body": "public static SinkConfig validateUpdate(SinkConfig existingConfig, SinkConfig newConfig) {\n SinkConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants differ\");\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_329 | {
"fields": [],
"file": "pulsar-io/influxdb/src/test/java/org/apache/pulsar/io/influxdb/InfluxDBGenericRecordSinkTest.java",
"identifier": "InfluxDBGenericRecordSinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void openInfluxV2() throws Exception {\n Map<String, Object> map = new HashMap();\n map.put(\"influxdbUrl\", \"http://localhost:9999\");\n map.put(\"token\", \"xxxx\");\n map.put(\"organization\", \"example-org\");\n map.put(\"bucket\", \"example-bucket\... | {
"fields": [
{
"declarator": "sink",
"modifier": "protected",
"original_string": "protected Sink<GenericRecord> sink;",
"type": "Sink<GenericRecord>",
"var_name": "sink"
}
],
"file": "pulsar-io/influxdb/src/main/java/org/apache/pulsar/io/influxdb/InfluxDBGenericRecordSink.ja... | {
"body": "@Override\n public void open(Map<String, Object> map, SinkContext sinkContext) throws Exception {\n try {\n val configV2 = InfluxDBSinkConfig.load(map);\n configV2.validate();\n sink = new InfluxDBSink();\n } catch (Exception e) {\n try {\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_145 | {
"fields": [],
"file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/scheduler/RoundRobinSchedulerTest.java",
"identifier": "RoundRobinSchedulerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRebalance() {\n Function.FunctionMetaData function1 = Function.FunctionMetaData.newBuilder()\n .setFunctionDetails(Function.FunctionDetails.newBuilder().setName(\"func-1\")\n .setNamespace(\"namespace-1\").setTenant(\"tenant-1\").setPa... | {
"fields": [],
"file": "pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/scheduler/RoundRobinScheduler.java",
"identifier": "RoundRobinScheduler",
"interfaces": "implements IScheduler",
"methods": [
{
"class_method_signature": "RoundRobinScheduler.schedule(List<Instance> una... | {
"body": "@Override\n public List<Assignment> rebalance(List<Assignment> currentAssignments, Set<String> workers) {\n\n Map<String, List<Instance>> workerToAssignmentMap = new HashMap<>();\n\n workers.forEach(workerId -> workerToAssignmentMap.put(workerId, new LinkedList<>()));\n\n currentAss... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_515 | {
"fields": [
{
"declarator": "pulsarSourceBuilder",
"modifier": "private",
"original_string": "private PulsarSourceBuilder pulsarSourceBuilder;",
"type": "PulsarSourceBuilder",
"var_name": "pulsarSourceBuilder"
}
],
"file": "pulsar-flink/src/test/java/org/apache/flink/stream... | {
"body": "@Test(expectedExceptions = NullPointerException.class)\n public void testSubscriptionInitialPosition() {\n pulsarSourceBuilder.subscriptionInitialPosition(null);\n }",
"class_method_signature": "PulsarSourceBuilderTest.testSubscriptionInitialPosition()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "SERVICE_URL = \"pulsar://localhost:6650\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";",
"type": "String",
"var_name": "SERVICE_URL"
},
{
"declarator": "AC... | {
"body": "public PulsarSourceBuilder<T> subscriptionInitialPosition(SubscriptionInitialPosition initialPosition) {\n Preconditions.checkNotNull(initialPosition, \"subscription initial position cannot be null\");\n this.consumerConfigurationData.setSubscriptionInitialPosition(initialPosition);\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_80 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java",
"identifier": "JSONSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNotAllowNullSchema() throws JSONException {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).withAlwaysAllowNull(false).build());\n Assert.assertEquals(jsonSchema.getSchemaInfo().getType(), SchemaType.JSON);\n S... | {
"fields": [
{
"declarator": "JSON_MAPPER = ThreadLocal.withInitial(() -> {\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n return mapper... | {
"body": "public static <T> JSONSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n SchemaReader<T> reader = schemaDefinition.getSchemaReaderOpt()\n .orElseGet(() -> new JacksonJsonReader<>(JSON_MAPPER.get(), schemaDefinition.getPojo()));\n SchemaWriter<T> writer = schemaDefinition.ge... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_450 | {
"fields": [
{
"declarator": "underlyingService",
"modifier": "private",
"original_string": "private SchemaRegistryService underlyingService;",
"type": "SchemaRegistryService",
"var_name": "underlyingService"
},
{
"declarator": "service",
"modifier": "private",
... | {
"body": "@Test\n public void testGetLatestSchema() {\n String schemaId = \"test-schema-id\";\n CompletableFuture<SchemaAndMetadata> getFuture = new CompletableFuture<>();\n when(underlyingService.getSchema(eq(schemaId))).thenReturn(getFuture);\n assertSame(getFuture, service.getSchema... | {
"fields": [
{
"declarator": "service",
"modifier": "private final",
"original_string": "private final SchemaRegistryService service;",
"type": "SchemaRegistryService",
"var_name": "service"
}
],
"file": "pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/va... | {
"body": "@Override\n public CompletableFuture<SchemaAndMetadata> getSchema(String schemaId) {\n return this.service.getSchema(schemaId);\n }",
"class_method_signature": "SchemaRegistryServiceWithSchemaDataValidator.getSchema(String schemaId)",
"constructor": false,
"full_signature": "@Override pu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_295 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ZookeeperCacheTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ZookeeperCacheTest.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Test(timeOut = 10000)\n public void testChildrenCacheZnodeCreatedAfterCache() throws Exception {\n\n ZooKeeperCache zkCacheService = new LocalZooKeeperCache(zkClient, 30, executor);\n ZooKeeperChildrenCache cache = new ZooKeeperChildrenCache(zkCacheService, \"/test\");\n\n // Creat... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperCache.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public <T> void process(WatchedEvent event, final CacheUpdater<T> updater) {\n final String path = event.getPath();\n if (path != null) {\n dataCache.synchronous().invalidate(path);\n childrenCache.synchronous().invalidate(path);\n // sometimes zk triggers one... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_96 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/generic/GenericSchemaImplTest.java",
"identifier": "GenericSchemaImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenericJsonSchema() {\n Schema<Foo> encodeSchema = Schema.JSON(Foo.class);\n GenericSchema decodeSchema = GenericSchemaImpl.of(encodeSchema.getSchemaInfo());\n testEncodeAndDecodeGenericRecord(encodeSchema, decodeSchema);\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "fields",
"modifier": "protected final",
"original_string": "protected final List<Field> fields;",
"type": "List<Field>",
"var_name": "fields"
},
{
"declarator": "useProvidedSchemaAsReaderSchema",
"modifier": "protected final",
... | {
"body": "public static GenericSchemaImpl of(SchemaInfo schemaInfo) {\n return of(schemaInfo, true);\n }",
"class_method_signature": "GenericSchemaImpl.of(SchemaInfo schemaInfo)",
"constructor": false,
"full_signature": "public static GenericSchemaImpl of(SchemaInfo schemaInfo)",
"identifier": "of"... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_503 | {
"fields": [
{
"declarator": "pulsarSourceBuilder",
"modifier": "private",
"original_string": "private PulsarSourceBuilder pulsarSourceBuilder;",
"type": "PulsarSourceBuilder",
"var_name": "pulsarSourceBuilder"
}
],
"file": "pulsar-flink/src/test/java/org/apache/flink/stream... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testBuildWithoutSettingRequiredProperties() throws PulsarClientException {\n pulsarSourceBuilder.build();\n }",
"class_method_signature": "PulsarSourceBuilderTest.testBuildWithoutSettingRequiredProperties()",
"constru... | {
"fields": [
{
"declarator": "SERVICE_URL = \"pulsar://localhost:6650\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";",
"type": "String",
"var_name": "SERVICE_URL"
},
{
"declarator": "AC... | {
"body": "public SourceFunction<T> build() throws PulsarClientException{\n Preconditions.checkArgument(StringUtils.isNotBlank(this.clientConfigurationData.getServiceUrl()),\n \"a service url is required\");\n Preconditions.checkArgument((this.consumerConfigurationData.getTopicNames() != ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_153 | {
"fields": [
{
"declarator": "TEST_TENANT = \"tenant\"",
"modifier": "private static final",
"original_string": "private static final String TEST_TENANT = \"tenant\";",
"type": "String",
"var_name": "TEST_TENANT"
},
{
"declarator": "TEST_NAMESPACE = \"namespace\"",
... | {
"body": "@Test\n public void testCreateJobName() throws Exception {\n verifyCreateJobNameWithBackwardCompatibility();\n verifyCreateJobNameWithUpperCaseFunctionName();\n verifyCreateJobNameWithDotFunctionName();\n verifyCreateJobNameWithDotAndUpperCaseFunctionName();\n verifyCr... | {
"fields": [
{
"declarator": "ENV_SHARD_ID = \"SHARD_ID\"",
"modifier": "private static final",
"original_string": "private static final String ENV_SHARD_ID = \"SHARD_ID\";",
"type": "String",
"var_name": "ENV_SHARD_ID"
},
{
"declarator": "maxJobNameSize = 55",
"... | {
"body": "public static String createJobName(Function.FunctionDetails functionDetails) {\n return createJobName(functionDetails.getTenant(),\n functionDetails.getNamespace(),\n functionDetails.getName());\n }",
"class_method_signature": "KubernetesRuntime.createJobName(Funct... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_446 | {
"fields": [
{
"declarator": "zkc",
"modifier": "private",
"original_string": "private MockZooKeeper zkc;",
"type": "MockZooKeeper",
"var_name": "zkc"
}
],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java",
"identifier":... | {
"body": "@Test\n public void concurrent() throws Exception {\n int Threads = 10;\n int Iterations = 100;\n\n CyclicBarrier barrier = new CyclicBarrier(Threads);\n CountDownLatch counter = new CountDownLatch(Threads);\n ExecutorService executor = Executors.newCachedThreadPool();... | {
"fields": [
{
"declarator": "prefix",
"modifier": "private final",
"original_string": "private final String prefix;",
"type": "String",
"var_name": "prefix"
},
{
"declarator": "generatorInstanceId",
"modifier": "private final",
"original_string": "private ... | {
"body": "public String getNextId() {\n return String.format(\"%s-%d-%d\", prefix, generatorInstanceId, counter.getAndIncrement());\n }",
"class_method_signature": "DistributedIdGenerator.getNextId()",
"constructor": false,
"full_signature": "public String getNextId()",
"identifier": "getNextId",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_79 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java",
"identifier": "AvroSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecodeByteBuf() {\n AvroSchema<Foo> avroSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n\n Foo foo1 = new Foo();\n foo1.setField1(\"foo1\");\n foo1.setField2(\"bar1\");\n foo1.setField4(new Bar());\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(AvroSchema.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(AvroSchema.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static <T> AvroSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n ClassLoader pojoClassLoader = null;\n if (schemaDefinition.getPojo() != null) {\n pojoClassLoader = schemaDefinition.getPojo().getClassLoader();\n }\n return new AvroSchema<>(parseSchemaInfo(... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_368 | {
"fields": [
{
"declarator": "log = Logger.get(TestPulsarMetadata.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(TestPulsarMetadata.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "pulsar-sql/presto-pu... | {
"body": "@Test(dataProvider = \"rewriteNamespaceDelimiter\", singleThreaded = true)\n public void testListTableColumns(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n Map<SchemaTableName, List<ColumnMetadata>> tableColumnsMap\n = this.pulsarMetadata.listTa... | {
"fields": [
{
"declarator": "connectorId",
"modifier": "private final",
"original_string": "private final String connectorId;",
"type": "String",
"var_name": "connectorId"
},
{
"declarator": "pulsarAdmin",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix\n prefix) {\n\n requireNonNull(prefix, \"prefix is null\");\n\n ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder()... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_387 | {
"fields": [
{
"declarator": "SUBJECT = \"my-test-subject\"",
"modifier": "private static final",
"original_string": "private static final String SUBJECT = \"my-test-subject\";",
"type": "String",
"var_name": "SUBJECT"
}
],
"file": "pulsar-broker-common/src/test/java/org/apa... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testInitializeWhenSecretKeyFilePathIfNotExist() throws IOException {\n File secretKeyFile = File.createTempFile(\"secret_key_file_not_exist\", \".key\");\n assertTrue(secretKeyFile.delete());\n assertFalse(secr... | {
"fields": [
{
"declarator": "HTTP_HEADER_NAME = \"Authorization\"",
"modifier": "final static",
"original_string": "final static String HTTP_HEADER_NAME = \"Authorization\";",
"type": "String",
"var_name": "HTTP_HEADER_NAME"
},
{
"declarator": "HTTP_HEADER_VALUE_PREFI... | {
"body": "@Override\n public void initialize(ServiceConfiguration config) throws IOException, IllegalArgumentException {\n // we need to fetch the algorithm before we fetch the key\n this.publicKeyAlg = getPublicKeyAlgType(config);\n this.validationKey = getValidationKey(config);\n thi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_104 | {
"fields": [
{
"declarator": "NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"foo\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "EXPECTED_SCHEMA_JSON = \"{\\\"type\\\":\\\"record\\\",\\\"name\... | {
"body": "@Test\n public void testGenericOf() {\n try {\n ProtobufSchema<org.apache.pulsar.client.schema.proto.Test.TestMessage> protobufSchema\n = ProtobufSchema.ofGenericClass(org.apache.pulsar.client.schema.proto.Test.TestMessage.class,\n new HashMap<>())... | {
"fields": [
{
"declarator": "PARSING_INFO_PROPERTY = \"__PARSING_INFO__\"",
"modifier": "public static final",
"original_string": "public static final String PARSING_INFO_PROPERTY = \"__PARSING_INFO__\";",
"type": "String",
"var_name": "PARSING_INFO_PROPERTY"
}
],
"file": "... | {
"body": "public static <T> ProtobufSchema ofGenericClass(Class<T> pojo, Map<String, String> properties) {\n SchemaDefinition<T> schemaDefinition = SchemaDefinition.<T>builder().withPojo(pojo).withProperties(properties).build();\n return ProtobufSchema.of(schemaDefinition);\n }",
"class_method_sig... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_554 | {
"fields": [
{
"declarator": "Iterations = 1",
"modifier": "final static",
"original_string": "final static int Iterations = 1;",
"type": "int",
"var_name": "Iterations"
},
{
"declarator": "ReadIterations = 10000",
"modifier": "final static",
"original_stri... | {
"body": "@Test\n public void testComputeIfAbsent() {\n ConcurrentLongHashMap<Integer> map = new ConcurrentLongHashMap<>(16, 1);\n AtomicInteger counter = new AtomicInteger();\n LongFunction<Integer> provider = key -> counter.getAndIncrement();\n\n assertEquals(map.computeIfAbsent(0, p... | {
"fields": [
{
"declarator": "EmptyValue = null",
"modifier": "private static final",
"original_string": "private static final Object EmptyValue = null;",
"type": "Object",
"var_name": "EmptyValue"
},
{
"declarator": "DeletedValue = new Object()",
"modifier": "pr... | {
"body": "public V computeIfAbsent(long key, LongFunction<V> provider) {\n checkNotNull(provider);\n long h = hash(key);\n return getSection(h).put(key, null, (int) h, true, provider);\n }",
"class_method_signature": "ConcurrentLongHashMap.computeIfAbsent(long key, LongFunction<V> provider)... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_411 | {
"fields": [
{
"declarator": "protocol1 = \"protocol1\"",
"modifier": "private static final",
"original_string": "private static final String protocol1 = \"protocol1\";",
"type": "String",
"var_name": "protocol1"
},
{
"declarator": "handler1",
"modifier": "privat... | {
"body": "@Test\n public void testGetProtocol() {\n assertSame(handler1, handlers.protocol(protocol1));\n assertSame(handler2, handlers.protocol(protocol2));\n assertNull(handlers.protocol(protocol3));\n }",
"class_method_signature": "ProtocolHandlersTest.testGetProtocol()",
"construct... | {
"fields": [
{
"declarator": "handlers",
"modifier": "private final",
"original_string": "private final Map<String, ProtocolHandlerWithClassLoader> handlers;",
"type": "Map<String, ProtocolHandlerWithClassLoader>",
"var_name": "handlers"
}
],
"file": "pulsar-broker/src/main/... | {
"body": "public ProtocolHandler protocol(String protocol) {\n ProtocolHandlerWithClassLoader h = handlers.get(protocol);\n if (null == h) {\n return null;\n } else {\n return h.getHandler();\n }\n }",
"class_method_signature": "ProtocolHandlers.protocol(String ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_105 | {
"fields": [
{
"declarator": "NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"foo\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "EXPECTED_SCHEMA_JSON = \"{\\\"type\\\":\\\"record\\\",\\\"name\... | {
"body": "@Test\n public void testParsingInfoProperty() throws JsonProcessingException {\n ProtobufSchema<org.apache.pulsar.client.schema.proto.Test.TestMessage> protobufSchema\n = ProtobufSchema.of(org.apache.pulsar.client.schema.proto.Test.TestMessage.class);\n\n Assert.assertEquals... | {
"fields": [
{
"declarator": "PARSING_INFO_PROPERTY = \"__PARSING_INFO__\"",
"modifier": "public static final",
"original_string": "public static final String PARSING_INFO_PROPERTY = \"__PARSING_INFO__\";",
"type": "String",
"var_name": "PARSING_INFO_PROPERTY"
}
],
"file": "... | {
"body": "public static <T extends com.google.protobuf.GeneratedMessageV3> ProtobufSchema<T> of(Class<T> pojo) {\n return of(pojo, new HashMap<>());\n }",
"class_method_signature": "ProtobufSchema.of(Class<T> pojo)",
"constructor": false,
"full_signature": "public static ProtobufSchema<T> of(Class<T>... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_555 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/GrowablePriorityLongPairQueueTest.java",
"identifier": "GrowablePriorityLongPairQueueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemove() {\n GrowablePriorityLongPairQueue queue = new GrowablePriorityLongPairQueue();\n\n assertTrue(queue.isEmpty());\n queue.add(1, 1);\n assertFalse(queue.isEmpty());\n\n assertFalse(queue.remove(1, 0));\n assertFalse(queue.isEmpty()... | {
"fields": [
{
"declarator": "data",
"modifier": "private",
"original_string": "private long[] data;",
"type": "long[]",
"var_name": "data"
},
{
"declarator": "capacity",
"modifier": "private",
"original_string": "private int capacity;",
"type": "int"... | {
"body": "public synchronized boolean remove(long item1, long item2) {\n boolean removed = false;\n\n int index = 0;\n for (int i = 0; i < this.size; i++) {\n if (data[index] == item1 && data[index + 1] == item2) {\n removeAtWithoutLock(index);\n removed ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_410 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtilsTest.java",
"identifier": "ProtocolHandlerUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLoadProtocolHandlerWrongHandlerClass() throws Exception {\n ProtocolHandlerDefinition def = new ProtocolHandlerDefinition();\n def.setHandlerClass(Runnable.class.getName());\n def.setDescription(\"test-protocol-handler\");\n\n String archivePath = \"/p... | {
"fields": [
{
"declarator": "PULSAR_PROTOCOL_HANDLER_DEFINITION_FILE = \"pulsar-protocol-handler.yml\"",
"modifier": "static final",
"original_string": "static final String PULSAR_PROTOCOL_HANDLER_DEFINITION_FILE = \"pulsar-protocol-handler.yml\";",
"type": "String",
"var_name": "P... | {
"body": "static ProtocolHandlerWithClassLoader load(ProtocolHandlerMetadata metadata,\n String narExtractionDirectory) throws IOException {\n NarClassLoader ncl = NarClassLoader.getFromArchive(\n metadata.getArchivePath().toAbsolutePath().toFile(),\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_369 | {
"fields": [
{
"declarator": "stringTopicName = TopicName.get(\"persistent\", \"tenant-1\", \"ns-1\", \"topic-1\")",
"modifier": "private static final",
"original_string": "private static final TopicName stringTopicName = TopicName.get(\"persistent\", \"tenant-1\", \"ns-1\", \"topic-1\");",
... | {
"body": "@Test\n public void testPulsarPrimitiveSchemaHandler() {\n PulsarPrimitiveSchemaHandler pulsarPrimitiveSchemaHandler;\n RawMessage rawMessage = mock(RawMessage.class);\n SchemaInfo schemaInfoInt8 = SchemaInfo.builder().type(SchemaType.INT8).build();\n pulsarPrimitiveSchemaHan... | {
"fields": [
{
"declarator": "schemaInfo",
"modifier": "private final",
"original_string": "private final SchemaInfo schemaInfo;",
"type": "SchemaInfo",
"var_name": "schemaInfo"
},
{
"declarator": "schema",
"modifier": "private final",
"original_string": "p... | {
"body": "PulsarPrimitiveSchemaHandler(SchemaInfo schemaInfo) {\n this.schemaInfo = schemaInfo;\n this.schema = (AbstractSchema<?>) AutoConsumeSchema.getSchema(schemaInfo);\n }",
"class_method_signature": "PulsarPrimitiveSchemaHandler.PulsarPrimitiveSchemaHandler(SchemaInfo schemaInfo)",
"constr... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_386 | {
"fields": [
{
"declarator": "SUBJECT = \"my-test-subject\"",
"modifier": "private static final",
"original_string": "private static final String SUBJECT = \"my-test-subject\";",
"type": "String",
"var_name": "SUBJECT"
}
],
"file": "pulsar-broker-common/src/test/java/org/apa... | {
"body": "@Test(expectedExceptions = IOException.class)\n public void testInitializeWhenSecretKeyIsValidPathOrBase64() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_SECRET_KEY,\n \"secret_key_file_not_e... | {
"fields": [
{
"declarator": "HTTP_HEADER_NAME = \"Authorization\"",
"modifier": "final static",
"original_string": "final static String HTTP_HEADER_NAME = \"Authorization\";",
"type": "String",
"var_name": "HTTP_HEADER_NAME"
},
{
"declarator": "HTTP_HEADER_VALUE_PREFI... | {
"body": "@Override\n public void initialize(ServiceConfiguration config) throws IOException, IllegalArgumentException {\n // we need to fetch the algorithm before we fetch the key\n this.publicKeyAlg = getPublicKeyAlgType(config);\n this.validationKey = getValidationKey(config);\n thi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_97 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/generic/GenericSchemaImplTest.java",
"identifier": "GenericSchemaImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAutoJsonSchema() {\n // configure the schema info provider\n MultiVersionSchemaInfoProvider multiVersionSchemaInfoProvider = mock(MultiVersionSchemaInfoProvider.class);\n GenericSchema genericAvroSchema = GenericSchemaImpl.of(Schema.AVRO(Foo.class).getSchemaI... | {
"fields": [
{
"declarator": "fields",
"modifier": "protected final",
"original_string": "protected final List<Field> fields;",
"type": "List<Field>",
"var_name": "fields"
},
{
"declarator": "useProvidedSchemaAsReaderSchema",
"modifier": "protected final",
... | {
"body": "public static GenericSchemaImpl of(SchemaInfo schemaInfo) {\n return of(schemaInfo, true);\n }",
"class_method_signature": "GenericSchemaImpl.of(SchemaInfo schemaInfo)",
"constructor": false,
"full_signature": "public static GenericSchemaImpl of(SchemaInfo schemaInfo)",
"identifier": "of"... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_502 | {
"fields": [
{
"declarator": "pulsarSourceBuilder",
"modifier": "private",
"original_string": "private PulsarSourceBuilder pulsarSourceBuilder;",
"type": "PulsarSourceBuilder",
"var_name": "pulsarSourceBuilder"
}
],
"file": "pulsar-flink/src/test/java/org/apache/flink/stream... | {
"body": "@Test\n public void testBuild() throws PulsarClientException {\n SourceFunction sourceFunction = pulsarSourceBuilder\n .serviceUrl(\"testServiceUrl\")\n .topic(\"testTopic\")\n .subscriptionName(\"testSubscriptionName\")\n .subscriptionI... | {
"fields": [
{
"declarator": "SERVICE_URL = \"pulsar://localhost:6650\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";",
"type": "String",
"var_name": "SERVICE_URL"
},
{
"declarator": "AC... | {
"body": "public SourceFunction<T> build() throws PulsarClientException{\n Preconditions.checkArgument(StringUtils.isNotBlank(this.clientConfigurationData.getServiceUrl()),\n \"a service url is required\");\n Preconditions.checkArgument((this.consumerConfigurationData.getTopicNames() != ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_152 | {
"fields": [
{
"declarator": "factory",
"modifier": "private",
"original_string": "private KubernetesRuntimeFactory factory;",
"type": "KubernetesRuntimeFactory",
"var_name": "factory"
},
{
"declarator": "userJarFile",
"modifier": "private final",
"original... | {
"body": "@Test\n public void testDynamicConfigMapLoading() throws Exception {\n\n String changeConfigMap = \"changeMap\";\n String changeConfigNamespace = \"changeConfigNamespace\";\n\n KubernetesRuntimeFactory kubernetesRuntimeFactory = getKuberentesRuntimeFactory();\n CoreV1Api core... | {
"fields": [
{
"declarator": "NUM_RETRIES = 5",
"modifier": "static",
"original_string": "static int NUM_RETRIES = 5;",
"type": "int",
"var_name": "NUM_RETRIES"
},
{
"declarator": "SLEEP_BETWEEN_RETRIES_MS = 500",
"modifier": "static",
"original_string": "s... | {
"body": "static void fetchConfigMap(CoreV1Api coreClient, String changeConfigMap,\n String changeConfigMapNamespace,\n KubernetesRuntimeFactory kubernetesRuntimeFactory) {\n try {\n V1ConfigMap v1ConfigMap = coreClient.readNamespacedConfi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_447 | {
"fields": [
{
"declarator": "zkc",
"modifier": "private",
"original_string": "private MockZooKeeper zkc;",
"type": "MockZooKeeper",
"var_name": "zkc"
}
],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java",
"identifier":... | {
"body": "@Test\n public void invalidZnode() throws Exception {\n zkc.create(\"/my/test/invalid\", \"invalid-number\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);\n\n DistributedIdGenerator gen = new DistributedIdGenerator(zkc, \"/my/test/invalid\", \"p\");\n\n // It shoul... | {
"fields": [
{
"declarator": "prefix",
"modifier": "private final",
"original_string": "private final String prefix;",
"type": "String",
"var_name": "prefix"
},
{
"declarator": "generatorInstanceId",
"modifier": "private final",
"original_string": "private ... | {
"body": "public String getNextId() {\n return String.format(\"%s-%d-%d\", prefix, generatorInstanceId, counter.getAndIncrement());\n }",
"class_method_signature": "DistributedIdGenerator.getNextId()",
"constructor": false,
"full_signature": "public String getNextId()",
"identifier": "getNextId",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_78 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java",
"identifier": "AvroSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDateAndTimestamp() {\n RecordSchemaBuilder recordSchemaBuilder =\n SchemaBuilder.record(\"org.apache.pulsar.client.avro.generated.NasaMission\");\n recordSchemaBuilder.field(\"id\")\n .type(SchemaType.INT32);\n recordSchemaBuilder.field(\"name\")\n .ty... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(AvroSchema.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(AvroSchema.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "public static <T> AvroSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n ClassLoader pojoClassLoader = null;\n if (schemaDefinition.getPojo() != null) {\n pojoClassLoader = schemaDefinition.getPojo().getClassLoader();\n }\n return new AvroSchema<>(parseSchemaInfo(... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_294 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ZookeeperCacheTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ZookeeperCacheTest.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Test(timeOut = 10000)\n public void testChildrenCache() throws Exception {\n zkClient.create(\"/test\", new byte[0], null, null);\n\n ZooKeeperCache zkCacheService = new LocalZooKeeperCache(zkClient, 30, executor);\n ZooKeeperChildrenCache cache = new ZooKeeperChildrenCache(zkCache... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperCache.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public <T> void process(WatchedEvent event, final CacheUpdater<T> updater) {\n final String path = event.getPath();\n if (path != null) {\n dataCache.synchronous().invalidate(path);\n childrenCache.synchronous().invalidate(path);\n // sometimes zk triggers one... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_144 | {
"fields": [
{
"declarator": "schedulerManager",
"modifier": "private",
"original_string": "private SchedulerManager schedulerManager;",
"type": "SchedulerManager",
"var_name": "schedulerManager"
},
{
"declarator": "functionMetaDataManager",
"modifier": "private"... | {
"body": "@Test\n public void testSchedule() throws Exception {\n\n List<Function.FunctionMetaData> functionMetaDataList = new LinkedList<>();\n long version = 5;\n Function.FunctionMetaData function1 = Function.FunctionMetaData.newBuilder()\n .setFunctionDetails(Function.Funct... | {
"fields": [
{
"declarator": "workerConfig",
"modifier": "private final",
"original_string": "private final WorkerConfig workerConfig;",
"type": "WorkerConfig",
"var_name": "workerConfig"
},
{
"declarator": "errorNotifier",
"modifier": "private final",
"ori... | {
"body": "public Future<?> schedule() {\n return scheduleInternal(() -> {\n workerStatsManager.scheduleTotalExecTimeStart();\n invokeScheduler();\n workerStatsManager.scheduleTotalExecTimeEnd();\n }, \"Encountered error when invoking scheduler\");\n }",
"class_meth... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_514 | {
"fields": [
{
"declarator": "pulsarSourceBuilder",
"modifier": "private",
"original_string": "private PulsarSourceBuilder pulsarSourceBuilder;",
"type": "PulsarSourceBuilder",
"var_name": "pulsarSourceBuilder"
}
],
"file": "pulsar-flink/src/test/java/org/apache/flink/stream... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testSubscriptionNameWithBlank() {\n pulsarSourceBuilder.subscriptionName(\" \");\n }",
"class_method_signature": "PulsarSourceBuilderTest.testSubscriptionNameWithBlank()",
"constructor": false,
"full_signature": "@T... | {
"fields": [
{
"declarator": "SERVICE_URL = \"pulsar://localhost:6650\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";",
"type": "String",
"var_name": "SERVICE_URL"
},
{
"declarator": "AC... | {
"body": "public PulsarSourceBuilder<T> subscriptionName(String subscriptionName) {\n Preconditions.checkArgument(StringUtils.isNotBlank(subscriptionName),\n \"subscriptionName cannot be blank\");\n this.consumerConfigurationData.setSubscriptionName(subscriptionName);\n return thi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_81 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java",
"identifier": "JSONSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllowNullSchema() throws JSONException {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n Assert.assertEquals(jsonSchema.getSchemaInfo().getType(), SchemaType.JSON);\n Schema.Parser parser = new Sche... | {
"fields": [
{
"declarator": "JSON_MAPPER = ThreadLocal.withInitial(() -> {\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n return mapper... | {
"body": "public static <T> JSONSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n SchemaReader<T> reader = schemaDefinition.getSchemaReaderOpt()\n .orElseGet(() -> new JacksonJsonReader<>(JSON_MAPPER.get(), schemaDefinition.getPojo()));\n SchemaWriter<T> writer = schemaDefinition.ge... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_451 | {
"fields": [
{
"declarator": "underlyingService",
"modifier": "private",
"original_string": "private SchemaRegistryService underlyingService;",
"type": "SchemaRegistryService",
"var_name": "underlyingService"
},
{
"declarator": "service",
"modifier": "private",
... | {
"body": "@Test\n public void testGetSchemaByVersion() {\n String schemaId = \"test-schema-id\";\n CompletableFuture<SchemaAndMetadata> getFuture = new CompletableFuture<>();\n when(underlyingService.getSchema(eq(schemaId), any(SchemaVersion.class)))\n .thenReturn(getFuture);\n ... | {
"fields": [
{
"declarator": "service",
"modifier": "private final",
"original_string": "private final SchemaRegistryService service;",
"type": "SchemaRegistryService",
"var_name": "service"
}
],
"file": "pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/va... | {
"body": "@Override\n public CompletableFuture<SchemaAndMetadata> getSchema(String schemaId) {\n return this.service.getSchema(schemaId);\n }",
"class_method_signature": "SchemaRegistryServiceWithSchemaDataValidator.getSchema(String schemaId)",
"constructor": false,
"full_signature": "@Override pu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_282 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Subscription Name cannot be altered\")\n public void testMergeDifferentSubname() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"sourceSubsc... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java",
"identifier": "SinkConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SinkConfigUtils.convert(SinkConfig sinkConfig, ExtractedSinkDetails sinkDetails)",
... | {
"body": "public static SinkConfig validateUpdate(SinkConfig existingConfig, SinkConfig newConfig) {\n SinkConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants differ\");\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_328 | {
"fields": [],
"file": "pulsar-io/influxdb/src/test/java/org/apache/pulsar/io/influxdb/InfluxDBGenericRecordSinkTest.java",
"identifier": "InfluxDBGenericRecordSinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void openInfluxV1() throws Exception {\n Map<String, Object> map = new HashMap<>();\n map.put(\"influxdbUrl\", \"http://localhost:8086\");\n map.put(\"database\", \"test_db\");\n\n InfluxDBGenericRecordSink sink = new InfluxDBGenericRecordSink();\n try {... | {
"fields": [
{
"declarator": "sink",
"modifier": "protected",
"original_string": "protected Sink<GenericRecord> sink;",
"type": "Sink<GenericRecord>",
"var_name": "sink"
}
],
"file": "pulsar-io/influxdb/src/main/java/org/apache/pulsar/io/influxdb/InfluxDBGenericRecordSink.ja... | {
"body": "@Override\n public void open(Map<String, Object> map, SinkContext sinkContext) throws Exception {\n try {\n val configV2 = InfluxDBSinkConfig.load(map);\n configV2.validate();\n sink = new InfluxDBSink();\n } catch (Exception e) {\n try {\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_543 | {
"fields": [
{
"declarator": "Iterations = 1",
"modifier": "final static",
"original_string": "final static int Iterations = 1;",
"type": "int",
"var_name": "Iterations"
},
{
"declarator": "ReadIterations = 1000",
"modifier": "final static",
"original_strin... | {
"body": "@Test\n public void testComputeIfAbsent() {\n ConcurrentOpenHashMap<Integer, Integer> map = new ConcurrentOpenHashMap<>(16, 1);\n AtomicInteger counter = new AtomicInteger();\n Function<Integer, Integer> provider = key -> counter.getAndIncrement();\n\n assertEquals(map.comput... | {
"fields": [
{
"declarator": "EmptyKey = null",
"modifier": "private static final",
"original_string": "private static final Object EmptyKey = null;",
"type": "Object",
"var_name": "EmptyKey"
},
{
"declarator": "DeletedKey = new Object()",
"modifier": "private st... | {
"body": "public V computeIfAbsent(K key, Function<K, V> provider) {\n checkNotNull(key);\n checkNotNull(provider);\n long h = hash(key);\n return getSection(h).put(key, null, (int) h, true, provider);\n }",
"class_method_signature": "ConcurrentOpenHashMap.computeIfAbsent(K key, Func... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_113 | {
"fields": [
{
"declarator": "resolver",
"modifier": "private",
"original_string": "private PulsarServiceNameResolver resolver;",
"type": "PulsarServiceNameResolver",
"var_name": "resolver"
}
],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/PulsarService... | {
"body": "@Test(expectedExceptions = IllegalStateException.class)\n public void testResolveUrlBeforeUpdateServiceUrl() throws Exception {\n resolver.resolveHostUri();\n }",
"class_method_signature": "PulsarServiceNameResolverTest.testResolveUrlBeforeUpdateServiceUrl()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "serviceUri",
"modifier": "private volatile",
"original_string": "private volatile ServiceURI serviceUri;",
"type": "ServiceURI",
"var_name": "serviceUri"
},
{
"declarator": "serviceUrl",
"modifier": "private volatile",
"origina... | {
"body": "@Override\n public URI resolveHostUri() {\n InetSocketAddress host = resolveHost();\n String hostUrl = serviceUri.getServiceScheme() + \"://\" + host.getHostName() + \":\" + host.getPort();\n return URI.create(hostUrl);\n }",
"class_method_signature": "PulsarServiceNameResolver... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_406 | {
"fields": [
{
"declarator": "TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\"",
"modifier": "private final static",
"original_string": "private final static String TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\";",
"type": "String",
... | {
"body": "@Test\n public void testClientServerConnection() throws Exception {\n addBrokerToZk(2);\n\n final CompletableFuture<BaseCommand> promise = new CompletableFuture<>();\n NioEventLoopGroup workerGroup = connectToService(service.getServiceUrl(), promise, false);\n assertEquals(pr... | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final ServiceConfig config;",
"type": "ServiceConfig",
"var_name": "config"
},
{
"declarator": "serviceUrl",
"modifier": "private",
"original_string": "private S... | {
"body": "public String getServiceUrl() {\n return serviceUrl;\n }",
"class_method_signature": "DiscoveryService.getServiceUrl()",
"constructor": false,
"full_signature": "public String getServiceUrl()",
"identifier": "getServiceUrl",
"invocations": [],
"modifiers": "public",
"parameters": "(... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_39 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test\n public void testRoundRobinPartitionMessageRouterImplInstance() throws NoSuchFieldException, IllegalAccessException {\n ProducerConfigurationData producerConfigurationData = new ProducerConfigurationData();\n producerConfigurationData.setMessageRoutingMode(MessageRoutingMode.RoundRo... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PartitionedProducerImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PartitionedProducerImpl.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "private MessageRouter getMessageRouter() {\n MessageRouter messageRouter;\n\n MessageRoutingMode messageRouteMode = conf.getMessageRoutingMode();\n\n switch (messageRouteMode) {\n case CustomPartition:\n messageRouter = checkNotNull(conf.getCustomMessageRouter... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_390 | {
"fields": [],
"file": "pulsar-broker-common/src/test/java/org/apache/pulsar/broker/validator/MultipleListenerValidatorTest.java",
"identifier": "MultipleListenerValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testAppearTogether() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setAdvertisedAddress(\"127.0.0.1\");\n config.setAdvertisedListeners(\"internal:pulsar://192.168.1.11:6660,internal:pu... | {
"fields": [],
"file": "pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java",
"identifier": "MultipleListenerValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "MultipleListenerValidator.validateAndAnalysisAdvertisedListener(Servi... | {
"body": "public static Map<String, AdvertisedListener> validateAndAnalysisAdvertisedListener(ServiceConfiguration config) {\n if (StringUtils.isNotBlank(config.getAdvertisedListeners()) && StringUtils.isNotBlank(config.getAdvertisedAddress())) {\n throw new IllegalArgumentException(\"`advertisedLi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_187 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Batch Configs cannot be found\")\n public void testPushWithoutRightConfig() throws Exception {\n pushConfig.clear();\n batchSourceExecutor.open(pushConfig, context);\n }",
"class_method_signature": "Bat... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_42 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplTest.java",
"identifier": "BatchMessageIdImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void compareToTest() {\n BatchMessageIdImpl batchMsgId1 = new BatchMessageIdImpl(0, 0, 0, 0);\n BatchMessageIdImpl batchMsgId2 = new BatchMessageIdImpl(1, 1, 1, 1);\n\n assertEquals(batchMsgId1.compareTo(batchMsgId2), -1);\n assertEquals(batchMsgId2.compareTo(b... | {
"fields": [
{
"declarator": "NO_BATCH = -1",
"modifier": "private final static",
"original_string": "private final static int NO_BATCH = -1;",
"type": "int",
"var_name": "NO_BATCH"
},
{
"declarator": "batchIndex",
"modifier": "private final",
"original_str... | {
"body": "@Override\n public int compareTo(MessageId o) {\n if (o instanceof BatchMessageIdImpl) {\n BatchMessageIdImpl other = (BatchMessageIdImpl) o;\n return ComparisonChain.start()\n .compare(this.ledgerId, other.ledgerId)\n .compare(this.entryId, oth... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_538 | {
"fields": [
{
"declarator": "channel",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Channel channel;",
"type": "Channel",
"var_name": "channel"
},
{
"declarator": "eventLoop",
"modifier": "private",
"original_string": "private D... | {
"body": "@Test\n public void toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedAfter() throws Exception {\n CompletableFuture<Channel> future = ChannelFutures.toCompletableFuture(channelFuture);\n Assert.assertFalse(future.isDone());\n\n Exception failure = new Exception(... | {
"fields": [],
"file": "pulsar-common/src/main/java/org/apache/pulsar/common/util/netty/ChannelFutures.java",
"identifier": "ChannelFutures",
"interfaces": "",
"methods": [
{
"class_method_signature": "ChannelFutures.ChannelFutures()",
"constructor": true,
"full_signature": "private Ch... | {
"body": "public static CompletableFuture<Channel> toCompletableFuture(ChannelFuture channelFuture) {\n Objects.requireNonNull(channelFuture, \"channelFuture cannot be null\");\n\n CompletableFuture<Channel> adapter = new CompletableFuture<>();\n if (channelFuture.isDone()) {\n if (ch... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_168 | {
"fields": [
{
"declarator": "mockTable",
"modifier": "private",
"original_string": "private Table<ByteBuf, ByteBuf> mockTable;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "mockTable"
},
{
"declarator": "stateContext",
"modifier": "private",
"original_... | {
"body": "@Test\n public void testGetValue() throws Exception {\n ByteBuf returnedValue = Unpooled.copiedBuffer(\"test-value\", UTF_8);\n when(mockTable.get(any(ByteBuf.class)))\n .thenReturn(FutureUtils.value(returnedValue));\n ByteBuffer result = stateContext.get(\"test-key\").ge... | {
"fields": [
{
"declarator": "table",
"modifier": "private final",
"original_string": "private final Table<ByteBuf, ByteBuf> table;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "table"
}
],
"file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/inst... | {
"body": "@Override\n public CompletableFuture<ByteBuffer> get(String key) {\n return table.get(Unpooled.wrappedBuffer(key.getBytes(UTF_8))).thenApply(\n data -> {\n try {\n if (data != null) {\n ByteBuffer result = ByteBuf... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_492 | {
"fields": [],
"file": "pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdTopics.java",
"identifier": "TestCmdTopics",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFindFirstLedgerWithinThreshold() throws Exception {\n List<LedgerInfo> ledgers = new ArrayList<>();\n ledgers.add(newLedger(0, 10, 1000));\n ledgers.add(newLedger(1, 10, 2000));\n ledgers.add(newLedger(2, 10, 3000));\n\n // test huge threshold\n... | {
"fields": [
{
"declarator": "topics",
"modifier": "private final",
"original_string": "private final Topics topics;",
"type": "Topics",
"var_name": "topics"
}
],
"file": "pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java",
"identifier": "CmdTopi... | {
"body": "static MessageId findFirstLedgerWithinThreshold(List<PersistentTopicInternalStats.LedgerInfo> ledgers,\n long sizeThreshold) {\n long suffixSize = 0L;\n\n ledgers = Lists.reverse(ledgers);\n long previousLedger = ledgers.get(0).ledgerI... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_241 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Processing Guarantees cannot be altered\")\n public void testMergeDifferentProcessingGuarantees() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = ... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_304 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class);",
"type": "Logger",
... | {
"body": "@Test\n public void testGcsNoBucketConfigured() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"google-cloud-storage\");\n File tmpKeyFile = File.createTempFile(\"gcsOffload\", \"json\");\n conf.setGcsManagedLedgerOffl... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);",
"type": "Logger",
"var_nam... | {
"body": "@VisibleForTesting\n static BlobStoreManagedLedgerOffloader create(OffloadPolicies conf,\n OrderedScheduler scheduler) throws IOException {\n return create(conf, Maps.newHashMap(), scheduler);\n }",
"class_method_signature": "BlobStoreManagedL... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_15 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BackoffTest.java",
"identifier": "BackoffTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void mandatoryStopTestNegativeTest() {\n Backoff backoff = new Backoff(100, TimeUnit.MILLISECONDS, 60, TimeUnit.SECONDS, 1900, TimeUnit.MILLISECONDS);\n assertEquals(backoff.next(), 100);\n backoff.next(); // 200\n backoff.next(); // 400\n backoff.next()... | {
"fields": [
{
"declarator": "DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100)",
"modifier": "public static final",
"original_string": "public static final long DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100);",
"type": "long",
"var_name": "D... | {
"body": "public long next() {\n long current = this.next;\n if (current < max) {\n this.next = Math.min(this.next * 2, this.max);\n }\n\n // Check for mandatory stop\n if (!mandatoryStopMade) {\n long now = clock.millis();\n long timeElapsedSinceFi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_580 | {
"fields": [
{
"declarator": "defaultJson = \"{\\\"policy1\\\":{\\\"namespaces\\\":[\\\"pulsar/use/test.*\\\"],\\\"primary\\\":[\\\"prod1-broker[1-3].messaging.use.example.com\\\"],\\\"secondary\\\":[\\\"prod1-broker.*.use.example.com\\\"],\\\"auto_failover_policy\\\":{\\\"policy_type\\\":\\\"min_available... | {
"body": "@Test\n public void testDeletePolicy() throws Exception {\n NamespaceIsolationPolicies policies = this.getDefaultTestPolicies();\n policies.deletePolicy(\"non-existing-policy\");\n assertFalse(policies.getPolicies().isEmpty());\n\n policies.deletePolicy(\"policy1\");\n ... | {
"fields": [
{
"declarator": "policies = null",
"modifier": "private",
"original_string": "private Map<String, NamespaceIsolationData> policies = null;",
"type": "Map<String, NamespaceIsolationData>",
"var_name": "policies"
}
],
"file": "pulsar-common/src/main/java/org/apach... | {
"body": "public void deletePolicy(String policyName) {\n policies.remove(policyName);\n }",
"class_method_signature": "NamespaceIsolationPolicies.deletePolicy(String policyName)",
"constructor": false,
"full_signature": "public void deletePolicy(String policyName)",
"identifier": "deletePolicy",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_216 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Processing Guarantees cannot be altered\")\n public void testMergeDifferentProcessingGuarantees() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpda... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java",
"identifier": "SourceConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SourceConfigUtils.convert(SourceConfig sourceConfig, ExtractedSourceDetails sourceDe... | {
"body": "public static SourceConfig validateUpdate(SourceConfig existingConfig, SourceConfig newConfig) {\n SourceConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants diffe... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_353 | {
"fields": [],
"file": "pulsar-io/kinesis/src/test/java/org/apache/pulsar/io/kinesis/UtilsTest.java",
"identifier": "UtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testJsonSerialization() throws Exception {\n\n final String[] keyNames = { \"key1\", \"key2\" };\n final String key1Value = \"test1\";\n final String key2Value = \"test2\";\n final byte[][] keyValues = { key1Value.getBytes(), key2Value.getBytes() };\n ... | {
"fields": [
{
"declarator": "PAYLOAD_FIELD = \"payloadBase64\"",
"modifier": "private static final",
"original_string": "private static final String PAYLOAD_FIELD = \"payloadBase64\";",
"type": "String",
"var_name": "PAYLOAD_FIELD"
},
{
"declarator": "PROPERTIES_FIELD... | {
"body": "public static String serializeRecordToJson(Record<byte[]> record) {\n checkNotNull(record, \"record can't be null\");\n\n JsonObject result = new JsonObject();\n result.addProperty(PAYLOAD_FIELD, getEncoder().encodeToString(record.getValue()));\n if (record.getProperties() != nu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_596 | {
"fields": [],
"file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/MetaStoreImplTest.java",
"identifier": "MetaStoreImplTest",
"interfaces": "",
"superclass": "extends MockedBookKeeperTestCase"
} | {
"body": "@Test(timeOut = 20000)\n void readMalformedCursorNode() throws Exception {\n MetaStore store = new MetaStoreImpl(new ZKMetadataStore(zkc), executor);\n\n zkc.create(\"/managed-ledgers/my_test\", \"\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);\n zkc.create(\"/ma... | {
"fields": [
{
"declarator": "BASE_NODE = \"/managed-ledgers\"",
"modifier": "private static final",
"original_string": "private static final String BASE_NODE = \"/managed-ledgers\";",
"type": "String",
"var_name": "BASE_NODE"
},
{
"declarator": "PREFIX = BASE_NODE + \... | {
"body": "@Override\n public void asyncGetCursorInfo(String ledgerName, String cursorName,\n MetaStoreCallback<ManagedCursorInfo> callback) {\n String path = PREFIX + ledgerName + \"/\" + cursorName;\n if (log.isDebugEnabled()) {\n log.debug(\"Reading from {}\", path);\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_579 | {
"fields": [
{
"declarator": "defaultJson = \"{\\\"policy1\\\":{\\\"namespaces\\\":[\\\"pulsar/use/test.*\\\"],\\\"primary\\\":[\\\"prod1-broker[1-3].messaging.use.example.com\\\"],\\\"secondary\\\":[\\\"prod1-broker.*.use.example.com\\\"],\\\"auto_failover_policy\\\":{\\\"policy_type\\\":\\\"min_available... | {
"body": "@Test\n public void testDefaultConstructor() throws Exception {\n NamespaceIsolationPolicies policies = new NamespaceIsolationPolicies();\n assertTrue(policies.getPolicies().isEmpty());\n\n byte[] outJson = ObjectMapperFactory.create().writeValueAsBytes(policies.getPolicies());\n ... | {
"fields": [
{
"declarator": "policies = null",
"modifier": "private",
"original_string": "private Map<String, NamespaceIsolationData> policies = null;",
"type": "Map<String, NamespaceIsolationData>",
"var_name": "policies"
}
],
"file": "pulsar-common/src/main/java/org/apach... | {
"body": "public Map<String, NamespaceIsolationData> getPolicies() {\n return this.policies;\n }",
"class_method_signature": "NamespaceIsolationPolicies.getPolicies()",
"constructor": false,
"full_signature": "public Map<String, NamespaceIsolationData> getPolicies()",
"identifier": "getPolicies",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_129 | {
"fields": [],
"file": "pulsar-functions/secrets/src/test/java/org/apache/pulsar/functions/secretsproviderconfigurator/KubernetesSecretsProviderConfiguratorTest.java",
"identifier": "KubernetesSecretsProviderConfiguratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConfigValidation() throws Exception {\n KubernetesSecretsProviderConfigurator provider = new KubernetesSecretsProviderConfigurator();\n try {\n HashMap<String, Object> map = new HashMap<String, Object>();\n map.put(\"secretname\", \"randomsecre... | {
"fields": [
{
"declarator": "ID_KEY = \"path\"",
"modifier": "private static",
"original_string": "private static String ID_KEY = \"path\";",
"type": "String",
"var_name": "ID_KEY"
},
{
"declarator": "KEY_KEY = \"key\"",
"modifier": "private static",
"orig... | {
"body": "@Override\n public void doAdmissionChecks(AppsV1Api appsV1Api, CoreV1Api coreV1Api, String jobNamespace, Function.FunctionDetails functionDetails) {\n if (!StringUtils.isEmpty(functionDetails.getSecretsMap())) {\n Type type = new TypeToken<Map<String, Object>>() {\n }.getTyp... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_7 | {
"fields": [],
"file": "pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java",
"identifier": "PulsarKafkaProducerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPulsarKafkaInterceptor() throws PulsarClientException {\n // Arrange\n PulsarClient mockClient = mock(PulsarClient.class);\n ProducerBuilder mockProducerBuilder = mock(ProducerBuilder.class);\n org.apache.pulsar.client.api.Producer mockProducer = mock(... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClient client;",
"type": "PulsarClient",
"var_name": "client"
},
{
"declarator": "pulsarProducerBuilder",
"modifier": "private final",
"original_stri... | {
"body": "@Override\n public Future<RecordMetadata> send(ProducerRecord<K, V> record) {\n return send(record, null);\n }",
"class_method_signature": "PulsarKafkaProducer.send(ProducerRecord<K, V> record)",
"constructor": false,
"full_signature": "@Override public Future<RecordMetadata> send(Produc... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_200 | {
"fields": [
{
"declarator": "consumerConfigs = new HashMap<>()",
"modifier": "private static",
"original_string": "private static Map<String, ConsumerConfig> consumerConfigs = new HashMap<>();",
"type": "Map<String, ConsumerConfig>",
"var_name": "consumerConfigs"
},
{
... | {
"body": "@Test\n public void testDefaultSerDe() throws Exception {\n\n PulsarSourceConfig pulsarConfig = getPulsarConfigs(false);\n // set type to void\n pulsarConfig.setTypeClassName(String.class.getName());\n consumerConfigs.put(\"persistent://sample/ns1/test_result\",\n ... | {
"fields": [
{
"declarator": "pulsarClient",
"modifier": "private final",
"original_string": "private final PulsarClient pulsarClient;",
"type": "PulsarClient",
"var_name": "pulsarClient"
},
{
"declarator": "pulsarSourceConfig",
"modifier": "private final",
... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n // Setup schemas\n log.info(\"Opening pulsar source with config: {}\", pulsarSourceConfig);\n Map<String, ConsumerConfig<T>> configs = setupConsumerConfigs();\n\n for (M... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_345 | {
"fields": [],
"file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java",
"identifier": "TestAbstractConfigurationProvider",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReusableChannel() throws Exception {\n String agentName = \"agent1\";\n Map<String, String> properties = getPropertiesForChannel(agentName,\n RecyclableChannel.class.getName());\n MemoryConfigurationProvider provider =\n new Memo... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);",
"type": "Logger",
"var_n... | {
"body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_54 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "consumerBuilderImpl",
... | {
"body": "@Test\n public void testConsumerBuilderImpl() throws PulsarClientException {\n Consumer consumer = mock(Consumer.class);\n when(consumerBuilderImpl.subscribeAsync())\n .thenReturn(CompletableFuture.completedFuture(consumer));\n assertNotNull(consumerBuilderImpl.topic(... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private C... | {
"body": "public ConsumerBuilderImpl(PulsarClientImpl client, Schema<T> schema) {\n this(client, new ConsumerConfigurationData<T>(), schema);\n }",
"class_method_signature": "ConsumerBuilderImpl.ConsumerBuilderImpl(PulsarClientImpl client, Schema<T> schema)",
"constructor": true,
"full_signature": "p... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_191 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Bad config passed to TestTriggerer\")\n public void testPushWithoutRightTriggererConfig() throws Exception {\n Map<String, Object> badConfig = new HashMap<>();\n badConfig.put(\"something\", \"else\");\n ... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_484 | {
"fields": [
{
"declarator": "buf",
"modifier": "private",
"original_string": "private ByteBuf buf;",
"type": "ByteBuf",
"var_name": "buf"
},
{
"declarator": "stream",
"modifier": "private",
"original_string": "private StatsOutputStream stream;",
"typ... | {
"body": "@Test\n public void testPairs() {\n stream.writePair(\"my-count\", 1);\n assertEquals(str(), \"\\\"my-count\\\":1\");\n\n stream.writePair(\"my-rate\", 0.0);\n assertEquals(str(), \"\\\"my-rate\\\":0.0\");\n\n stream.writePair(\"my-flag\", true);\n assertEquals(... | {
"fields": [
{
"declarator": "separators = new Stack<>()",
"modifier": "private final",
"original_string": "private final Stack<Boolean> separators = new Stack<>();",
"type": "Stack<Boolean>",
"var_name": "separators"
}
],
"file": "pulsar-broker/src/main/java/org/apache/puls... | {
"body": "public StatsOutputStream writePair(String name, boolean value) {\n checkSeparator();\n write('\"').writeEncoded(name).write(\"\\\":\").write(value);\n return this;\n }",
"class_method_signature": "StatsOutputStream.writePair(String name, boolean value)",
"constructor": false,
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_257 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Output Serde mismatch\")\n public void testMergeDifferentSerde() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"out... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_312 | {
"fields": [],
"file": "pulsar-io/netty/src/test/java/org/apache/pulsar/io/netty/http/NettyHttpChannelInitializerTest.java",
"identifier": "NettyHttpChannelInitializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChannelInitializer() throws Exception {\n NioSocketChannel channel = new NioSocketChannel();\n\n NettyHttpChannelInitializer nettyChannelInitializer = new NettyHttpChannelInitializer(\n new NettyHttpServerHandler(new NettySource()), null);\n ne... | {
"fields": [
{
"declarator": "sslCtx",
"modifier": "private final",
"original_string": "private final SslContext sslCtx;",
"type": "SslContext",
"var_name": "sslCtx"
},
{
"declarator": "handler",
"modifier": "private",
"original_string": "private ChannelInb... | {
"body": "@Override\n protected void initChannel(SocketChannel socketChannel) throws Exception {\n if (sslCtx != null) {\n socketChannel.pipeline().addLast(sslCtx.newHandler(socketChannel.alloc()));\n }\n socketChannel.pipeline().addLast(new HttpServerCodec());\n socketChann... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_365 | {
"fields": [
{
"declarator": "log = Logger.get(TestPulsarMetadata.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(TestPulsarMetadata.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "pulsar-sql/presto-pu... | {
"body": "@Test(dataProvider = \"rewriteNamespaceDelimiter\", singleThreaded = true)\n public void testGetTableMetadataTableInvalidSchema(String delimiter) throws PulsarAdminException {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n SchemaInfo badSchemaInfo = new SchemaInfo();\n badS... | {
"fields": [
{
"declarator": "connectorId",
"modifier": "private final",
"original_string": "private final String connectorId;",
"type": "String",
"var_name": "connectorId"
},
{
"declarator": "pulsarAdmin",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) {\n ConnectorTableMetadata connectorTableMetadata;\n SchemaTableName schemaTableName = convertTableHandle(table).toSchemaTableName();\n connectorTableMetadata = getTableM... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_220 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test\n public void testMergeDifferentResources() {\n SourceConfig sourceConfig = createSourceConfig();\n Resources resources = new Resources();\n resources.setCpu(0.3);\n resources.setRam(1232l);\n resources.setDisk(123456l);\n SourceConfig newSourceConfig = cr... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java",
"identifier": "SourceConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SourceConfigUtils.convert(SourceConfig sourceConfig, ExtractedSourceDetails sourceDe... | {
"body": "public static SourceConfig validateUpdate(SourceConfig existingConfig, SourceConfig newConfig) {\n SourceConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants diffe... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_559 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSetTest.java",
"identifier": "ConcurrentLongPairSetTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString() {\n\n ConcurrentLongPairSet set = new ConcurrentLongPairSet();\n\n set.add(0, 0);\n set.add(1, 1);\n set.add(3, 3);\n final String toString = \"{[3:3], [0:0], [1:1]}\";\n assertEquals(set.toString(), toString);\n }",
"clas... | {
"fields": [
{
"declarator": "EmptyItem = -1L",
"modifier": "private static final",
"original_string": "private static final long EmptyItem = -1L;",
"type": "long",
"var_name": "EmptyItem"
},
{
"declarator": "DeletedItem = -2L",
"modifier": "private static final"... | {
"body": "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append('{');\n final AtomicBoolean first = new AtomicBoolean(true);\n forEach((item1, item2) -> {\n if (!first.getAndSet(false)) {\n sb.append(\", \");\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_109 | {
"fields": [
{
"declarator": "executorService = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executorService = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executorService"
... | {
"body": "@Test(invocationTimeOut = 1000)\n public void testNotifyPendingReceivedCallback_CompleteWithException() {\n CompletableFuture<Message<ConsumerImpl>> receiveFuture = new CompletableFuture<>();\n consumer.pendingReceives.add(receiveFuture);\n Exception exception = new PulsarClientExce... | {
"fields": [
{
"declarator": "MAX_REDELIVER_UNACKNOWLEDGED = 1000",
"modifier": "private static final",
"original_string": "private static final int MAX_REDELIVER_UNACKNOWLEDGED = 1000;",
"type": "int",
"var_name": "MAX_REDELIVER_UNACKNOWLEDGED"
},
{
"declarator": "con... | {
"body": "void notifyPendingReceivedCallback(final Message<T> message, Exception exception) {\n if (pendingReceives.isEmpty()) {\n return;\n }\n\n // fetch receivedCallback from queue\n final CompletableFuture<Message<T>> receivedFuture = pendingReceives.poll();\n if (re... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_23 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testProducerBuilderImplWhenMaxPendingMessagesAcrossPartitionsPropertyIsInvalid() {\n producerBuilderImpl.maxPendingMessagesAcrossPartitions(999);\n }",
"class_method_signature": "ProducerBuilderImplTest.testProducerBuil... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private P... | {
"body": "@Override\n public ProducerBuilder<T> maxPendingMessagesAcrossPartitions(int maxPendingMessagesAcrossPartitions) {\n conf.setMaxPendingMessagesAcrossPartitions(maxPendingMessagesAcrossPartitions);\n return this;\n }",
"class_method_signature": "ProducerBuilderImpl.maxPendingMessagesAc... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_298 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class);",
"type": "Logger",
... | {
"body": "@Test\n public void testHappyCase() throws Exception {\n LedgerOffloader offloader = new BlobStoreManagedLedgerOffloader(blobStore, BUCKET, scheduler,\n DEFAULT_BLOCK_SIZE, DEFAULT_READ_BUFFER_SIZE);\n offloader.offload(buildReadHandle(), UUID.randomUUID(), new HashMap<>()).... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);",
"type": "Logger",
"var_nam... | {
"body": "@Override\n public CompletableFuture<Void> offload(ReadHandle readHandle,\n UUID uuid,\n Map<String, String> extraMetadata) {\n CompletableFuture<Void> promise = new CompletableFuture<>();\n scheduler.choos... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_332 | {
"fields": [],
"file": "pulsar-io/influxdb/src/test/java/org/apache/pulsar/io/influxdb/v1/InfluxDBSinkConfigTest.java",
"identifier": "InfluxDBSinkConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public final void loadFromMapTest() throws IOException {\n Map<String, Object> map = new HashMap<>();\n map.put(\"influxdbUrl\", \"http://localhost:8086\");\n map.put(\"database\", \"test_db\");\n map.put(\"consistencyLevel\", \"ONE\");\n map.put(\"logLevel\", ... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "influxdbUrl",
"modifier": "@FieldDo... | {
"body": "public static InfluxDBSinkConfig load(String yamlFile) throws IOException {\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n return mapper.readValue(new File(yamlFile), InfluxDBSinkConfig.class);\n }",
"class_method_signature": "InfluxDBSinkConfig.load(String yamlFile)",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_277 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Processing Guarantees cannot be altered\")\n public void testMergeDifferentProcessingGuarantees() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkCon... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java",
"identifier": "SinkConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SinkConfigUtils.convert(SinkConfig sinkConfig, ExtractedSinkDetails sinkDetails)",
... | {
"body": "public static SinkConfig validateUpdate(SinkConfig existingConfig, SinkConfig newConfig) {\n SinkConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants differ\");\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.