id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
62117812_254
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeDifferentTimeout() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"timeoutMs\", 102l);\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionConfig, newFu...
{ "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_310
{ "fields": [ { "declarator": "history", "modifier": "private", "original_string": "private PulsarDatabaseHistory history;", "type": "PulsarDatabaseHistory", "var_name": "history" }, { "declarator": "position", "modifier": "private", "original_string": "priv...
{ "body": "@Test\n public void testExists() {\n // happy path\n testHistoryTopicContent(true);\n assertTrue(history.exists());\n\n // Set history to use dummy topic\n Configuration config = Configuration.create()\n .with(PulsarDatabaseHistory.SERVICE_URL, brokerUrl.toS...
{ "fields": [ { "declarator": "TOPIC = Field.create(CONFIGURATION_FIELD_PREFIX_STRING + \"pulsar.topic\")\n .withDisplayName(\"Database history topic name\")\n .withType(Type.STRING)\n .withWidth(Width.LONG)\n .withImportance(Importance.HIGH)\n .withDescription(\"The name ...
{ "body": "@Override\n public boolean exists() {\n setupClientIfNeeded();\n try (Reader<String> historyReader = pulsarClient.newReader(Schema.STRING)\n .topic(topicName)\n .startMessageId(MessageId.earliest)\n .create()\n ) {\n return historyReader.h...
{ "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_255
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeRuntimeFlags() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"runtimeFlags\", \"-Dfoo=bar2\");\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionConf...
{ "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_486
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java", "identifier": "PulsarBrokerStarterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadConfig() throws SecurityException, NoSuchMethodException, IOException, IllegalArgumentException,\n IllegalAccessException, InvocationTargetException {\n\n File testConfigFile = createValidBrokerConfigFile();\n Method targetMethod = PulsarBrokerStarter...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);", "type": "Logger", "var_name": "log" } ], "...
{ "body": "private static ServiceConfiguration loadConfig(String configFile) throws Exception {\n SLF4JBridgeHandler.removeHandlersForRootLogger();\n SLF4JBridgeHandler.install();\n ServiceConfiguration config = create((new FileInputStream(configFile)), ServiceConfiguration.class);\n // it...
{ "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_469
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java", "identifier": "BookKeeperClientFactoryImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetDefaultEnsemblePlacementPolicyRackAwareDisabled() {\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();\n AtomicReference<ZooKeeperCache> clientIsolationZkCache = new AtomicReference<>();\n ClientConfiguration bkConf = new C...
{ "fields": [ { "declarator": "rackawarePolicyZkCache = new AtomicReference<>()", "modifier": "private final", "original_string": "private final AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();", "type": "AtomicReference<ZooKeeperCache>", "var_name": ...
{ "body": "public static void setDefaultEnsemblePlacementPolicy(\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache,\n AtomicReference<ZooKeeperCache> clientIsolationZkCache,\n ClientConfiguration bkConf,\n ServiceConfiguration conf,\n ZooKeeper zkClient\n ) {\n if (...
{ "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_193
{ "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 = \"BatchSource does not implement the correct interface\")\n public void testPushWithoutRightSource() throws Exception {\n pushConfig.put(BatchSourceConfig.BATCHSOURCE_CLASSNAME_KEY, TestDiscoveryTriggerer.class...
{ "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_56
{ "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 testConsumerBuilderImplWhenTopicNamesVarargsHasNullTopic() {\n consumerBuilderImpl.topic(\"my-topic\", null);\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenTopicNamesVarargsHasNullT...
{ "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_347
{ "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 testReusableChannelNotReusedLater() throws Exception {\n String agentName = \"agent1\";\n Map<String, String> propertiesReusable = getPropertiesForChannel(agentName,\n RecyclableChannel.class\n .getName());\n Map<String, Stri...
{ "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_202
{ "fields": [ { "declarator": "TOPIC = \"persistent://sample/standalone/ns1/test_result\"", "modifier": "private static final", "original_string": "private static final String TOPIC = \"persistent://sample/standalone/ns1/test_result\";", "type": "String", "var_name": "TOPIC" } ...
{ "body": "@Test\n public void testVoidOutputClasses() throws Exception {\n PulsarSinkConfig pulsarConfig = getPulsarConfigs();\n // set type to void\n pulsarConfig.setTypeClassName(Void.class.getName());\n PulsarSink pulsarSink = new PulsarSink(getPulsarClient(), pulsarConfig, new Hash...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClient client;", "type": "PulsarClient", "var_name": "client" }, { "declarator": "pulsarSinkConfig", "modifier": "private final", "original_string": ...
{ "body": "@SuppressWarnings(\"unchecked\")\n @VisibleForTesting\n Schema<T> initializeSchema() throws ClassNotFoundException {\n if (StringUtils.isEmpty(this.pulsarSinkConfig.getTypeClassName())) {\n return (Schema<T>) Schema.BYTES;\n }\n\n Class<?> typeArg = Reflections.loadCla...
{ "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_5
{ "fields": [], "file": "pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/pulsar/client/kafka/compat/KafkaProducerInterceptorWrapperTest.java", "identifier": "KafkaProducerInterceptorWrapperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(dataProvider = \"serializers\")\n public void testGetDeserializer(Serializer serializer, Class deserializerClass) {\n Deserializer deserializer = KafkaProducerInterceptorWrapper.getDeserializer(serializer);\n assertEquals(deserializer.getClass(), deserializerClass);\n }", "class...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(KafkaProducerInterceptorWrapper.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(KafkaProducerInterceptorWrapper.class);", "type": "Logger", "var_nam...
{ "body": "static Deserializer getDeserializer(Serializer serializer) {\n if (serializer instanceof StringSerializer) {\n return new StringDeserializer();\n } else if (serializer instanceof LongSerializer) {\n return new LongDeserializer();\n } else if (serializer instanceof...
{ "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_594
{ "fields": [], "file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/MetaStoreImplTest.java", "identifier": "MetaStoreImplTest", "interfaces": "", "superclass": "extends MockedBookKeeperTestCase" }
{ "body": "@Test\n void deleteNonExistingML() throws Exception {\n MetaStore store = new MetaStoreImpl(new ZKMetadataStore(zkc), executor);\n\n AtomicReference<MetaStoreException> exception = new AtomicReference<>();\n CountDownLatch counter = new CountDownLatch(1);\n\n store.removeMana...
{ "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 removeManagedLedger(String ledgerName, MetaStoreCallback<Void> callback) {\n log.info(\"[{}] Remove ManagedLedger\", ledgerName);\n\n String path = PREFIX + ledgerName;\n store.delete(path, Optional.empty())\n .thenAcceptAsync(v -> {\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_351
{ "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 testSourceAndSinkThrowExceptionDuringConfiguration()\n throws Exception {\n String agentName = \"agent1\";\n String sourceType = UnconfigurableSource.class.getName();\n String channelType = \"memory\";\n String sinkType = UnconfigurableSink.clas...
{ "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_214
{ "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 = \"Namespaces differ\")\n public void testMergeDifferentNamespace() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"namespace\", \"...
{ "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_582
{ "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 testBrokerAssignment() throws Exception {\n NamespaceIsolationPolicies policies = this.getDefaultTestPolicies();\n NamespaceName ns = NamespaceName.get(\"pulsar/use/testns-1\");\n SortedSet<BrokerStatus> primaryCandidates = new TreeSet<>();\n BrokerStatus ...
{ "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 assignBroker(NamespaceName nsname, BrokerStatus brkStatus, SortedSet<BrokerStatus> primaryCandidates,\n SortedSet<BrokerStatus> secondaryCandidates, SortedSet<BrokerStatus> sharedCandidates) {\n NamespaceIsolationPolicy nsPolicy = this.getPolicyByNamespace(nsname);\n Br...
{ "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_428
{ "fields": [ { "declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"", "modifier": "private final", "original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";", "type": "String", "var_nam...
{ "body": "@Test\n public void testBrokerStatsMetrics() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n final String subName = \"newSub\";\n BrokerStats brokerStatsClient = admin.brokerStats();\n\n Consumer<byte[]> consumer = pulsarClient.newConsum...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BrokerService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@Override\n public void close() throws IOException {\n log.info(\"Shutting down Pulsar Broker service\");\n\n if (pulsar.getConfigurationCache() != null) {\n pulsar.getConfigurationCache().policiesCache().unregisterListener(this);\n }\n\n // unloads all namespaces ...
{ "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_17
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BackoffTest.java", "identifier": "BackoffTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void mandatoryStopTest() {\n Clock mockClock = Mockito.mock(Clock.class);\n\n Backoff backoff = new Backoff(\n 100, TimeUnit.MILLISECONDS,\n 60, TimeUnit.SECONDS,\n 1900, TimeUnit.MILLISECONDS,\n mockClock\n );\n\n Mo...
{ "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 void reset() {\n this.next = this.initial;\n this.mandatoryStopMade = false;\n }", "class_method_signature": "Backoff.reset()", "constructor": false, "full_signature": "public void reset()", "identifier": "reset", "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_306
{ "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 testS3DriverConfiguredWell() throws Exception {\n PowerMockito.mockStatic(CredentialsUtil.class);\n PowerMockito.when(CredentialsUtil.getAWSCredentialProvider(any())).thenReturn(new AWSCredentialsProvider() {\n @Override\n public AWSCredentials get...
{ "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_243
{ "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 = \"Retain Key Ordering cannot be altered\")\n public void testMergeDifferentRetainKeyOrdering() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = creat...
{ "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_490
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java", "identifier": "PulsarBrokerStarterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMainRunBookieNoConfig() throws Exception {\n try {\n File testConfigFile = createValidBrokerConfigFile();\n String[] args = {\"-c\", testConfigFile.getAbsolutePath(), \"-rb\", \"-bc\", \"\"};\n PulsarBrokerStarter.main(args);\n f...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);", "type": "Logger", "var_name": "log" } ], "...
{ "body": "public static void main(String[] args) throws Exception {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss,SSS\");\n Thread.setDefaultUncaughtExceptionHandler((thread, exception) -> {\n System.out.println(String.format(\"%s [%s] error Uncaught exception in threa...
{ "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_40
{ "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 testCustomMessageRouterInstance() throws NoSuchFieldException, IllegalAccessException {\n ProducerConfigurationData producerConfigurationData = new ProducerConfigurationData();\n producerConfigurationData.setMessageRoutingMode(MessageRoutingMode.CustomPartition);\n ...
{ "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_185
{ "fields": [ { "declarator": "config", "modifier": "private", "original_string": "private InstanceConfig config;", "type": "InstanceConfig", "var_name": "config" }, { "declarator": "logger", "modifier": "private", "original_string": "private Logger logger;"...
{ "body": "@Test\n public void testPublishUsingDefaultSchema() throws Exception {\n context.newOutputMessage(\"sometopic\", null).value(\"Somevalue\").sendAsync();\n }", "class_method_signature": "ContextImplTest.testPublishUsingDefaultSchema()", "constructor": false, "full_signature": "@Test publi...
{ "fields": [ { "declarator": "config", "modifier": "private", "original_string": "private InstanceConfig config;", "type": "InstanceConfig", "var_name": "config" }, { "declarator": "logger", "modifier": "private", "original_string": "private Logger logger;"...
{ "body": "@Override\n public <O> TypedMessageBuilder<O> newOutputMessage(String topicName, Schema<O> schema) throws PulsarClientException {\n MessageBuilderImpl<O> messageBuilder = new MessageBuilderImpl<>();\n TypedMessageBuilder<O> typedMessageBuilder = getProducer(topicName, schema).newMessage();...
{ "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_238
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeDifferentInputSpec() {\n FunctionConfig functionConfig = createFunctionConfig();\n Map<String, ConsumerConfig> inputSpecs = new HashMap<>();\n inputSpecs.put(\"test-input\", ConsumerConfig.builder().isRegexPattern(true).serdeClassName(\"test-serde\").rec...
{ "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_392
{ "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_2() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setAdvertisedListeners(\" internal:pulsar://127.0.0.1:6660,\" + \" internal:pulsar://192.168.1.11:6660\");\n conf...
{ "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_404
{ "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 testBrokerDiscoveryRoundRobin() throws Exception {\n addBrokerToZk(5);\n String prevUrl = null;\n for (int i = 0; i < 10; i++) {\n String current = service.getDiscoveryProvider().nextBroker().getPulsarServiceUrl();\n assertNotEquals(prevUrl,...
{ "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 BrokerDiscoveryProvider getDiscoveryProvider() {\n return discoveryProvider;\n }", "class_method_signature": "DiscoveryService.getDiscoveryProvider()", "constructor": false, "full_signature": "public BrokerDiscoveryProvider getDiscoveryProvider()", "identifier": "getDiscoveryProvid...
{ "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_541
{ "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 testRemove() {\n ConcurrentOpenHashMap<String, String> map = new ConcurrentOpenHashMap<>();\n\n assertTrue(map.isEmpty());\n assertNull(map.put(\"1\", \"one\"));\n assertFalse(map.isEmpty());\n\n assertFalse(map.remove(\"0\", \"zero\"));\n as...
{ "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 remove(K key) {\n checkNotNull(key);\n long h = hash(key);\n return getSection(h).remove(key, null, (int) h);\n }", "class_method_signature": "ConcurrentOpenHashMap.remove(K key)", "constructor": false, "full_signature": "public V remove(K key)", "identifier": "remo...
{ "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_111
{ "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_InterceptorsWorksWithPrefetchDisabled() {\n CompletableFuture<Message<ConsumerImpl>> receiveFuture = new CompletableFuture<>();\n MessageImpl message = mock(MessageImpl.class);\n ConsumerImpl<ConsumerImp...
{ "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_280
{ "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 testMergeDifferentSecrets() {\n SinkConfig sinkConfig = createSinkConfig();\n Map<String, String> mySecrets = new HashMap<>();\n mySecrets.put(\"MyKey\", \"MyValue\");\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"secrets\", mySecrets);\n S...
{ "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_453
{ "fields": [ { "declarator": "underlyingService", "modifier": "private", "original_string": "private SchemaRegistryService underlyingService;", "type": "SchemaRegistryService", "var_name": "underlyingService" }, { "declarator": "service", "modifier": "private", ...
{ "body": "@Test\n public void testIsCompatibleWithGoodSchemaData() {\n String schemaId = \"test-schema-id\";\n SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;\n CompletableFuture<Boolean> future = new CompletableFuture<>();\n when(underlyingService.isCompatible...
{ "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<Boolean> isCompatible(String schemaId, SchemaData schema, SchemaCompatibilityStrategy strategy) {\n try {\n SchemaDataValidator.validateSchemaData(schema);\n } catch (InvalidSchemaDataException e) {\n return FutureUtil.failedFuture...
{ "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_83
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAllowNullEncodeAndDecode() {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).withAlwaysAllowNull(false).build());\n\n Foo foo1 = new Foo();\n foo1.setField1(\"foo1\");\n foo1.setField2(\"bar1\");\n ...
{ "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_146
{ "fields": [ { "declarator": "producerByteArray", "modifier": "static", "original_string": "static byte[] producerByteArray;", "type": "byte[]", "var_name": "producerByteArray" } ], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/FunctionMet...
{ "body": "@Test\n public void testListFunctions() throws PulsarClientException {\n FunctionMetaDataManager functionMetaDataManager = spy(\n new FunctionMetaDataManager(new WorkerConfig(),\n mock(SchedulerManager.class),\n mockPulsarClient(), Erro...
{ "fields": [ { "declarator": "functionMetaDataMap = new ConcurrentHashMap<>()", "modifier": "@VisibleForTesting\n final", "original_string": "@VisibleForTesting\n final Map<String, Map<String, Map<String, FunctionMetaData>>> functionMetaDataMap = new ConcurrentHashMap<>();", "type":...
{ "body": "public synchronized Collection<FunctionMetaData> listFunctions(String tenant, String namespace) {\n List<FunctionMetaData> ret = new LinkedList<>();\n\n if (!this.functionMetaDataMap.containsKey(tenant)) {\n return ret;\n }\n\n if (!this.functionMetaDataMap.get(tenant...
{ "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_516
{ "fields": [ { "declarator": "decoder", "modifier": "private", "original_string": "private PulsarDecoder decoder;", "type": "PulsarDecoder", "var_name": "decoder" } ], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/protocol/PulsarDecoderTest.java", "identifi...
{ "body": "@Test\n public void testChannelRead() throws Exception {\n long consumerId = 1234L;\n ByteBuf changeBuf = Commands.newActiveConsumerChange(consumerId, true);\n ByteBuf cmdBuf = changeBuf.slice(4, changeBuf.writerIndex() - 4);\n\n doNothing().when(decoder).handleActiveConsumer...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarDecoder.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarDecoder.class);", "type": "Logger", "var_name": "log" } ], "file": "puls...
{ "body": "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n // Get a buffer that contains the full frame\n ByteBuf buffer = (ByteBuf) msg;\n BaseCommand cmd = null;\n BaseCommand.Builder cmdBuilder = null;\n try {\n // De-...
{ "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_279
{ "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 testMergeDifferentUserConfig() {\n SinkConfig sinkConfig = createSinkConfig();\n Map<String, String> myConfig = new HashMap<>();\n myConfig.put(\"MyKey\", \"MyValue\");\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"configs\", myConfig);\n S...
{ "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_296
{ "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 testExistsCache() throws Exception {\n // Check existence after creation of the node\n zkClient.create(\"/test\", new byte[0], null, null);\n Thread.sleep(20);\n ZooKeeperCache zkCacheService = new LocalZooKeeperCache(zkClient, 30, executo...
{ "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 boolean exists(final String path) throws KeeperException, InterruptedException {\n return exists(path, this);\n }", "class_method_signature": "ZooKeeperCache.exists(final String path)", "constructor": false, "full_signature": "public boolean exists(final String path)", "identifier"...
{ "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_445
{ "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 simple() throws Exception {\n DistributedIdGenerator gen1 = new DistributedIdGenerator(zkc, \"/my/test/simple\", \"p\");\n\n assertEquals(gen1.getNextId(), \"p-0-0\");\n assertEquals(gen1.getNextId(), \"p-0-1\");\n assertEquals(gen1.getNextId(), \"p-0-2\")...
{ "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_500
{ "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": "TO...
{ "body": "@Test\n public void testConfigure() throws Exception {\n PulsarAvroTableSink sink = spySink();\n\n TableSink<Row> configuredSink = sink.configure(fieldNames, typeInformations);\n\n assertArrayEquals(fieldNames, configuredSink.getFieldNames());\n assertArrayEquals(typeInformat...
{ "fields": [ { "declarator": "clientConfigurationData", "modifier": "protected", "original_string": "protected ClientConfigurationData clientConfigurationData;", "type": "ClientConfigurationData", "var_name": "clientConfigurationData" }, { "declarator": "producerConfig...
{ "body": "@Override\n public TableSink<Row> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) {\n PulsarAvroTableSink sink = new PulsarAvroTableSink(\n clientConfigurationData, producerConfigurationData, routingKeyFieldName, recordClazz);\n\n sink.fieldNames = checkNotNu...
{ "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_150
{ "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 testAdmissionChecks() throws Exception {\n factory = createKubernetesRuntimeFactory(null, null);\n FunctionDetails functionDetails = createFunctionDetails();\n factory.doAdmissionChecks(functionDetails);\n }", "class_method_signature": "KubernetesRuntimeFact...
{ "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": "@Override\n public void doAdmissionChecks(Function.FunctionDetails functionDetails) {\n KubernetesRuntime.doChecks(functionDetails);\n validateMinResourcesRequired(functionDetails);\n secretsProviderConfigurator.doAdmissionChecks(appsClient, coreClient, getOverriddenNamespace(functi...
{ "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_95
{ "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 testGenericAvroSchema() {\n Schema<Foo> encodeSchema = Schema.AVRO(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_384
{ "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 testValidationKeyWhenBlankPublicKeyIsPassed() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_PUBLIC_KEY, \" \");\n\n ServiceConfiguration c...
{ "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_412
{ "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 testInitialize() throws Exception {\n ServiceConfiguration conf = new ServiceConfiguration();\n handlers.initialize(conf);\n verify(handler1, times(1)).initialize(same(conf));\n verify(handler2, times(1)).initialize(same(conf));\n }", "class_method_si...
{ "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 void initialize(ServiceConfiguration conf) throws Exception {\n for (ProtocolHandler handler : handlers.values()) {\n handler.initialize(conf);\n }\n }", "class_method_signature": "ProtocolHandlers.initialize(ServiceConfiguration conf)", "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_107
{ "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_EmptyQueueNotThrowsException() {\n consumer.notifyPendingReceivedCallback(null, null);\n }", "class_method_signature": "ConsumerImplTest.testNotifyPendingReceivedCallback_EmptyQueueNotThrowsException()", "const...
{ "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_557
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSetTest.java", "identifier": "ConcurrentLongPairSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemove() {\n ConcurrentLongPairSet set = new ConcurrentLongPairSet();\n\n assertTrue(set.isEmpty());\n assertTrue(set.add(1, 1));\n assertFalse(set.isEmpty());\n\n assertFalse(set.remove(1, 0));\n assertFalse(set.isEmpty());\n asse...
{ "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": "public boolean remove(long item1, long item2) {\n checkBiggerEqualZero(item1);\n long h = hash(item1, item2);\n return getSection(h).remove(item1, item2, (int) h);\n }", "class_method_signature": "ConcurrentLongPairSet.remove(long item1, long item2)", "constructor": false, "fu...
{ "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_520
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/RateLimiterTest.java", "identifier": "RateLimiterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTryAcquire() throws Exception {\n final long rateTimeMSec = 1000;\n final int permits = 100;\n RateLimiter rate = new RateLimiter(permits, rateTimeMSec, TimeUnit.MILLISECONDS);\n for (int i = 0; i < permits; i++) {\n rate.tryAcquire();\n ...
{ "fields": [ { "declarator": "executorService", "modifier": "private final", "original_string": "private final ScheduledExecutorService executorService;", "type": "ScheduledExecutorService", "var_name": "executorService" }, { "declarator": "rateTime", "modifier":...
{ "body": "public synchronized boolean tryAcquire() {\n return tryAcquire(1);\n }", "class_method_signature": "RateLimiter.tryAcquire()", "constructor": false, "full_signature": "public synchronized boolean tryAcquire()", "identifier": "tryAcquire", "invocations": [ "tryAcquire" ], "modifi...
{ "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_170
{ "fields": [], "file": "pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/instance/InstanceUtilsTest.java", "identifier": "InstanceUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCalculateSubjectTypeForSource() {\n FunctionDetails.Builder builder = FunctionDetails.newBuilder();\n // no input topics mean source\n builder.setSource(Function.SourceSpec.newBuilder().build());\n assertEquals(InstanceUtils.calculateSubjectType(builde...
{ "fields": [], "file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceUtils.java", "identifier": "InstanceUtils", "interfaces": "", "methods": [ { "class_method_signature": "InstanceUtils.initializeSerDe(String serdeClassName, ClassLoader clsLoader, Class<?> t...
{ "body": "public Function.FunctionDetails.ComponentType calculateSubjectType(Function.FunctionDetails functionDetails) {\n if (functionDetails.getComponentType() != Function.FunctionDetails.ComponentType.UNKNOWN) {\n return functionDetails.getComponentType();\n }\n Function.SourceSpec...
{ "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_465
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/BrokerInterceptorWithClassLoaderTest.java", "identifier": "BrokerInterceptorWithClassLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWrapper() throws Exception {\n BrokerInterceptor h = mock(BrokerInterceptor.class);\n NarClassLoader loader = mock(NarClassLoader.class);\n BrokerInterceptorWithClassLoader wrapper = new BrokerInterceptorWithClassLoader(h, loader);\n\n PulsarService pu...
{ "fields": [ { "declarator": "interceptor", "modifier": "private final", "original_string": "private final BrokerInterceptor interceptor;", "type": "BrokerInterceptor", "var_name": "interceptor" }, { "declarator": "classLoader", "modifier": "private final", ...
{ "body": "@Override\n public void initialize(PulsarService pulsarService) throws Exception {\n this.interceptor.initialize(pulsarService);\n }", "class_method_signature": "BrokerInterceptorWithClassLoader.initialize(PulsarService pulsarService)", "constructor": false, "full_signature": "@Override ...
{ "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_259
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/ExceptionsTest.java", "identifier": "ExceptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRethrowIOException() {\n IOException ioe = new IOException(\"test\");\n try {\n rethrowIOException(ioe);\n fail(\"Should rethrow IOException\");\n } catch (IOException e) {\n assertSame(ioe, e);\n }\n }", "class_me...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Exceptions.java", "identifier": "Exceptions", "interfaces": "", "methods": [ { "class_method_signature": "Exceptions.rethrowIOException(Throwable cause)", "constructor": false, "full_signature...
{ "body": "public static void rethrowIOException(Throwable cause)\n throws IOException {\n if (cause instanceof IOException) {\n throw (IOException) cause;\n } else if (cause instanceof RuntimeException) {\n throw (RuntimeException) cause;\n } else if (cause insta...
{ "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_127
{ "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 testStringList() {\n TestConfig testConfig = createGoodConfig();\n testConfig.stringList = testIntegerList;\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage().contain...
{ "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_577
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/impl/AutoFailoverPolicyFactoryTest.java", "identifier": "AutoFailoverPolicyFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAutoFailoverPolicyFactory() {\n try {\n AutoFailoverPolicyFactory.create(new AutoFailoverPolicyData());\n Assert.fail(\"\");\n } catch (IllegalArgumentException e) {\n // Pass\n }\n try {\n AutoFailoverPolicy...
{ "fields": [], "file": "pulsar-common/src/main/java/org/apache/pulsar/common/policies/impl/AutoFailoverPolicyFactory.java", "identifier": "AutoFailoverPolicyFactory", "interfaces": "", "methods": [ { "class_method_signature": "AutoFailoverPolicyFactory.create(AutoFailoverPolicyData policyData)", ...
{ "body": "public static AutoFailoverPolicy create(AutoFailoverPolicyData policyData) {\n // TODO: Add more policy types when needed\n if (!AutoFailoverPolicyType.min_available.equals(policyData.policy_type)) {\n // right now, only support one type of policy: MinAvailablePolicy\n 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_598
{ "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 updatingCursorNode() 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\n final CompletableFu...
{ "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 asyncUpdateCursorInfo(String ledgerName, String cursorName, ManagedCursorInfo info, Stat stat,\n MetaStoreCallback<Void> callback) {\n log.info(\"[{}] [{}] Updating cursor info ledgerId={} mark-delete={}:{}\", ledgerName, cursorName,\n info.getCur...
{ "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_432
{ "fields": [ { "declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"", "modifier": "private final", "original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";", "type": "String", "var_nam...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Test\n public void testTlsAuthDisallowInsecure() throws Exception {\n final String topicName = \"persistent://prop/my-ns/newTopic\";\n final String subName = \"newSub\";\n Authentication auth;\n\n Set<String> providers = new HashSet<>(...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BrokerService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@Override\n public void close() throws IOException {\n log.info(\"Shutting down Pulsar Broker service\");\n\n if (pulsar.getConfigurationCache() != null) {\n pulsar.getConfigurationCache().policiesCache().unregisterListener(this);\n }\n\n // unloads all namespaces ...
{ "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_9
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/util/ObjectCacheTest.java", "identifier": "ObjectCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCache() {\n\n AtomicLong currentTime = new AtomicLong(0);\n\n Clock clock = mock(Clock.class);\n when(clock.millis()).then(invocation -> currentTime.longValue());\n\n AtomicInteger currentValue = new AtomicInteger(0);\n\n Supplier<Integer> cache...
{ "fields": [ { "declarator": "supplier", "modifier": "private final", "original_string": "private final Supplier<T> supplier;", "type": "Supplier<T>", "var_name": "supplier" }, { "declarator": "cachedInstance", "modifier": "private", "original_string": "pri...
{ "body": "public synchronized T get() {\n long now = clock.millis();\n if (cachedInstance == null || (now - lastRefreshTimestamp) >= cacheDurationMillis) {\n cachedInstance = supplier.get();\n lastRefreshTimestamp = now;\n }\n\n return cachedInstance;\n }", "cla...
{ "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_561
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/FileModifiedTimeUpdaterTest.java", "identifier": "FileModifiedTimeUpdaterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(dataProvider = \"files\")\n public void testFileModified(String fileName) throws IOException, InterruptedException {\n Path path = Paths.get(fileName);\n createFile(path);\n FileModifiedTimeUpdater fileModifiedTimeUpdater = new FileModifiedTimeUpdater(fileName);\n Threa...
{ "fields": [ { "declarator": "fileName", "modifier": "@Getter", "original_string": "@Getter\n String fileName;", "type": "String", "var_name": "fileName" }, { "declarator": "lastModifiedTime", "modifier": "@Getter", "original_string": "@Getter\n FileT...
{ "body": "public boolean checkAndRefresh() {\n FileTime newLastModifiedTime = updateLastModifiedTime();\n if (newLastModifiedTime != null && !newLastModifiedTime.equals(lastModifiedTime)) {\n this.lastModifiedTime = newLastModifiedTime;\n return true;\n }\n return 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_131
{ "fields": [], "file": "pulsar-functions/secrets/src/test/java/org/apache/pulsar/functions/secretsprovider/EnvironmentBasedSecretsProviderTest.java", "identifier": "EnvironmentBasedSecretsProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigValidation() throws Exception {\n EnvironmentBasedSecretsProvider provider = new EnvironmentBasedSecretsProvider();\n assertNull(provider.provideSecret(\"mySecretName\", \"Ignored\"));\n injectEnvironmentVariable(\"mySecretName\", \"SecretValue\");\n ...
{ "fields": [], "file": "pulsar-functions/secrets/src/main/java/org/apache/pulsar/functions/secretsprovider/EnvironmentBasedSecretsProvider.java", "identifier": "EnvironmentBasedSecretsProvider", "interfaces": "implements SecretsProvider", "methods": [ { "class_method_signature": "EnvironmentBasedSe...
{ "body": "@Override\n public String provideSecret(String secretName, Object pathToSecret) {\n return System.getenv(secretName);\n }", "class_method_signature": "EnvironmentBasedSecretsProvider.provideSecret(String secretName, Object pathToSecret)", "constructor": false, "full_signature": "@Overrid...
{ "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_424
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeExclusiveStickyKeyConsumerSelectorTest.java", "identifier": "HashRangeExclusiveStickyKeyConsumerSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = BrokerServiceException.ConsumerAssignException.class)\n public void testEmptyRanges() throws BrokerServiceException.ConsumerAssignException {\n HashRangeExclusiveStickyKeyConsumerSelector selector = new HashRangeExclusiveStickyKeyConsumerSelector(10);\n Consumer ...
{ "fields": [ { "declarator": "rangeSize", "modifier": "private final", "original_string": "private final int rangeSize;", "type": "int", "var_name": "rangeSize" }, { "declarator": "rangeMap", "modifier": "private final", "original_string": "private final Co...
{ "body": "@Override\n public void addConsumer(Consumer consumer) throws BrokerServiceException.ConsumerAssignException {\n validateKeySharedMeta(consumer);\n for (PulsarApi.IntRange intRange : consumer.getKeySharedMeta().getHashRangesList()) {\n rangeMap.put(intRange.getStart(), consumer)...
{ "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_218
{ "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 testMergeDifferentSecrets() {\n SourceConfig sourceConfig = createSourceConfig();\n Map<String, String> mySecrets = new HashMap<>();\n mySecrets.put(\"MyKey\", \"MyValue\");\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"secrets\", mySecrets)...
{ "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_166
{ "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 testPut() throws Exception {\n when(mockTable.put(any(ByteBuf.class), any(ByteBuf.class)))\n .thenReturn(FutureUtils.Void());\n stateContext.put(\"test-key\", ByteBuffer.wrap(\"test-value\".getBytes(UTF_8))).get();\n verify(mockTable, times(1)).put(\n ...
{ "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<Void> put(String key, ByteBuffer value) {\n if(value != null) {\n // Set position to off the buffer to the beginning.\n // If a user used an operation like ByteBuffer.allocate(4).putInt(count) to create a ByteBuffer to store to the state ...
{ "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_536
{ "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_shouldCompleteSuccessfully_channelFutureCompletedAfter() throws Exception {\n CompletableFuture<Channel> future = ChannelFutures.toCompletableFuture(channelFuture);\n Assert.assertFalse(future.isDone());\n\n channelFuture.setSuccess();\n ...
{ "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_473
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java", "identifier": "BookKeeperClientFactoryImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetExplicitLacInterval() {\n BookKeeperClientFactoryImpl factory = new BookKeeperClientFactoryImpl();\n ServiceConfiguration conf = new ServiceConfiguration();\n conf.setZookeeperServers(\"localhost:2181\");\n assertEquals(factory.createBkClientConfigu...
{ "fields": [ { "declarator": "rackawarePolicyZkCache = new AtomicReference<>()", "modifier": "private final", "original_string": "private final AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();", "type": "AtomicReference<ZooKeeperCache>", "var_name": ...
{ "body": "@VisibleForTesting\n ClientConfiguration createBkClientConfiguration(ServiceConfiguration conf) {\n ClientConfiguration bkConf = new ClientConfiguration();\n if (conf.getBookkeeperClientAuthenticationPlugin() != null\n && conf.getBookkeeperClientAuthenticationPlugin().trim()...
{ "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_189
{ "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 = \"BatchSourceTriggerer does not implement the correct interface\")\n public void testPushWithoutRightTriggerer() throws Exception {\n testBatchConfig.setDiscoveryTriggererClassName(TestBatchSource.class.getName...
{ "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_408
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtilsTest.java", "identifier": "ProtocolHandlerUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadProtocolHandler() throws Exception {\n ProtocolHandlerDefinition def = new ProtocolHandlerDefinition();\n def.setHandlerClass(MockProtocolHandler.class.getName());\n def.setDescription(\"test-protocol-handler\");\n\n String archivePath = \"/path/to...
{ "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_37
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtilsTest.java", "identifier": "ConfigurationDataUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadConfigurationDataWithUnknownFields() {\n ReaderConfigurationData confData = new ReaderConfigurationData();\n confData.setTopicName(\"unknown\");\n confData.setReceiverQueueSize(1000000);\n confData.setReaderName(\"unknown-reader\");\n Map<St...
{ "fields": [ { "declarator": "mapper = new FastThreadLocal<ObjectMapper>() {\n @Override\n protected ObjectMapper initialValue() throws Exception {\n return create();\n }\n }", "modifier": "private static final", "original_string": "private static final FastTh...
{ "body": "public static <T> T loadData(Map<String, Object> config,\n T existingData,\n Class<T> dataCls) {\n ObjectMapper mapper = getThreadLocal();\n try {\n String existingConfigJson = mapper.writeValueAsString(existingData);\...
{ "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_234
{ "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 = \"Namespaces differ\")\n public void testMergeDifferentNamespace() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"nam...
{ "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_371
{ "fields": [ { "declarator": "log = Logger.get(TestPulsarSplitManager.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(TestPulsarSplitManager.class);", "type": "Logger", "var_name": "log" } ], "file": "pulsar-sql/p...
{ "body": "@Test(dataProvider = \"rewriteNamespaceDelimiter\", singleThreaded = true)\n public void testPartitionFilter(String delimiter) throws Exception {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n for (TopicName topicName : partitionedTopicNames) {\n setup();\n l...
{ "fields": [ { "declarator": "connectorId", "modifier": "private final", "original_string": "private final String connectorId;", "type": "String", "var_name": "connectorId" }, { "declarator": "pulsarConnectorConfig", "modifier": "private final", "original_s...
{ "body": "@VisibleForTesting\n Collection<PulsarSplit> getSplitsPartitionedTopic(int numSplits, TopicName topicName, PulsarTableHandle\n tableHandle, SchemaInfo schemaInfo, TupleDomain<ColumnHandle> tupleDomain,\n OffloadPolicies offloadPolicies) throws Exception {\n\n List<Integer>...
{ "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_60
{ "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 testConsumerBuilderImplWhenTopicNamesHasBlankTopic() {\n List<String> topicNames = Arrays.asList(\"my-topic\", \" \");\n consumerBuilderImpl.topics(topicNames);\n }", "class_method_signature": "ConsumerBuilderImp...
{ "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> topics(List<String> topicNames) {\n checkArgument(topicNames != null && !topicNames.isEmpty(),\n \"Passed in topicNames list should not be null or empty.\");\n topicNames.stream().forEach(topicName ->\n checkArgument(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_263
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java", "identifier": "WindowConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSettingSlidingCountWindow() throws Exception {\n final Object[][] args = new Object[][]{\n {-1, 10},\n {10, -1},\n {0, 10},\n {10, 0},\n {0, 0},\n {-1, -1},\n {5, 10},\...
{ "fields": [ { "declarator": "DEFAULT_MAX_LAG_MS = 0", "modifier": "public static final", "original_string": "public static final long DEFAULT_MAX_LAG_MS = 0;", "type": "long", "var_name": "DEFAULT_MAX_LAG_MS" }, { "declarator": "DEFAULT_WATERMARK_EVENT_INTERVAL_MS = 1...
{ "body": "public static void validate(WindowConfig windowConfig) {\n if (windowConfig.getWindowLengthDurationMs() == null && windowConfig.getWindowLengthCount() == null) {\n throw new IllegalArgumentException(\"Window length is not specified\");\n }\n\n if (windowConfig.getWindowLengt...
{ "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_326
{ "fields": [ { "declarator": "defaultProps = new HashMap<>()", "modifier": "private", "original_string": "private Map<String, String> defaultProps = new HashMap<>();", "type": "Map<String, String>", "var_name": "defaultProps" }, { "declarator": "distributedConfig", ...
{ "body": "@Test\n public void testGetFromEmptyCallback() throws Exception {\n CompletableFuture<Map<ByteBuffer, ByteBuffer>> callbackFuture = new CompletableFuture<>();\n assertTrue(offsetBackingStore.get(\n Arrays.asList(ByteBuffer.wrap(\"empty-key\".getBytes(UTF_8))),\n (erro...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private Map<ByteBuffer, ByteBuffer> data;", "type": "Map<ByteBuffer, ByteBuffer>", "var_name": "data" }, { "declarator": "client", "modifier": "private", "original_string": "pri...
{ "body": "@Override\n public Future<Map<ByteBuffer, ByteBuffer>> get(Collection<ByteBuffer> keys,\n Callback<Map<ByteBuffer, ByteBuffer>> callback) {\n CompletableFuture<Void> endFuture = new CompletableFuture<>();\n readToEnd(endFuture);\n 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_449
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java", "identifier": "BookkeeperSchemaStorageTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testVersionFromBytes() {\n long version = System.currentTimeMillis();\n\n ByteBuffer bbPre240 = ByteBuffer.allocate(Long.SIZE);\n bbPre240.putLong(version);\n byte[] versionBytesPre240 = bbPre240.array();\n\n ByteBuffer bbPost240 = ByteBuffer.alloca...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BookkeeperSchemaStorage.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BookkeeperSchemaStorage.class);", "type": "Logger", "var_name": "log" },...
{ "body": "@Override\n public SchemaVersion versionFromBytes(byte[] version) {\n // The schema storage converts the schema from bytes to long\n // so it handles both cases 1) version is 64 bytes long pre 2.4.0;\n // 2) version is 8 bytes long post 2.4.0\n //\n // NOTE: if you are...
{ "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_76
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java", "identifier": "AvroSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLogicalType() {\n AvroSchema<SchemaLogicalType> avroSchema = AvroSchema.of(SchemaDefinition.<SchemaLogicalType>builder()\n .withPojo(SchemaLogicalType.class).withJSR310ConversionEnabled(true).build());\n\n SchemaLogicalType schemaLogicalType = new Sch...
{ "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_99
{ "fields": [ { "declarator": "foo", "modifier": "private", "original_string": "private Foo foo;", "type": "Foo", "var_name": "foo" }, { "declarator": "fooV2", "modifier": "private", "original_string": "private FooV2 fooV2;", "type": "FooV2", "va...
{ "body": "@Test\n public void testGenericAvroReaderByWriterSchema() {\n byte[] fooBytes = fooSchema.encode(foo);\n\n GenericAvroReader genericAvroSchemaByWriterSchema = new GenericAvroReader(fooSchema.getAvroSchema());\n GenericRecord genericRecordByWriterSchema = genericAvroSchemaByWriterSc...
{ "fields": [ { "declarator": "reader", "modifier": "private final", "original_string": "private final GenericDatumReader<GenericAvroRecord> reader;", "type": "GenericDatumReader<GenericAvroRecord>", "var_name": "reader" }, { "declarator": "encoder", "modifier": "...
{ "body": "@Override\n public GenericAvroRecord read(byte[] bytes, int offset, int length) {\n try {\n if (offset == 0 && this.offset > 0) {\n offset = this.offset;\n }\n Decoder decoder = DecoderFactory.get().binaryDecoder(bytes, offset, length - offset, null...
{ "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_275
{ "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 = \"isRegexPattern for input topic test-input cannot be altered\")\n public void testMergeDifferentInputSpecWithRegexChange() {\n SinkConfig sinkConfig = createSinkConfig();\n Map<String, ConsumerCon...
{ "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_330
{ "fields": [], "file": "pulsar-io/influxdb/src/test/java/org/apache/pulsar/io/influxdb/InfluxDBGenericRecordSinkTest.java", "identifier": "InfluxDBGenericRecordSinkTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = Exception.class,\n expectedExceptionsMessageRegExp = \"For InfluxDB V2:.*\")\n public void openInvalidInfluxConfig() throws Exception {\n InfluxDBGenericRecordSink sink = new InfluxDBGenericRecordSink();\n sink.open(new HashMap<>(), mock(SinkContext.cl...
{ "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_21
{ "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 testProducerBuilderImplWhenBatchingMaxPublishDelayPropertyIsNegative() {\n producerBuilderImpl.batchingMaxPublishDelay(-1, TimeUnit.MILLISECONDS);\n }", "class_method_signature": "ProducerBuilderImplTest.testProducerBui...
{ "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> batchingMaxPublishDelay(long batchDelay, @NonNull TimeUnit timeUnit) {\n conf.setBatchingMaxPublishDelayMicros(batchDelay, timeUnit);\n return this;\n }", "class_method_signature": "ProducerBuilderImpl.batchingMaxPublishDelay(long batchDelay, @Non...
{ "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_222
{ "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 = \"DiscoverTriggerer class cannot be updated for batchsources\")\n public void testMergeDifferentBatchTriggerer() {\n SourceConfig sourceConfig = createSourceConfigWithBatch();\n BatchSourceConfig b...
{ "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_388
{ "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 testInitializeWhenPublicKeyFilePathIsInvalid() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_PUBLIC_KEY,\n \"file://\" + \"invalid_p...
{ "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_367
{ "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 testGetColumnHandles(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n PulsarTableHandle pulsarTableHandle = new PulsarTableHandle(pulsarConnectorId.toString(), TOPIC_1.getNam...
{ "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<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle) {\n PulsarTableHandle pulsarTableHandle = convertTableHandle(tableHandle);\n\n ConnectorTableMetadata tableMetaData = getTableMetadata(pulsarTableHandle.toSchemaTableNa...
{ "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_415
{ "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 testNewChannelInitializersSuccess() {\n ChannelInitializer<SocketChannel> i1 = mock(ChannelInitializer.class);\n ChannelInitializer<SocketChannel> i2 = mock(ChannelInitializer.class);\n Map<InetSocketAddress, ChannelInitializer<SocketChannel>> p1Initializers = ne...
{ "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 Map<String, Map<InetSocketAddress, ChannelInitializer<SocketChannel>>> newChannelInitializers() {\n Map<String, Map<InetSocketAddress, ChannelInitializer<SocketChannel>>> channelInitializers = Maps.newHashMap();\n Set<InetSocketAddress> addresses = Sets.newHashSet();\n\n for (Ma...
{ "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_100
{ "fields": [ { "declarator": "foo", "modifier": "private", "original_string": "private Foo foo;", "type": "Foo", "var_name": "foo" }, { "declarator": "fooV2", "modifier": "private", "original_string": "private FooV2 fooV2;", "type": "FooV2", "va...
{ "body": "@Test\n public void testGenericAvroReaderByReaderSchema() {\n byte[] fooV2Bytes = fooV2Schema.encode(fooV2);\n\n GenericAvroReader genericAvroSchemaByReaderSchema = new GenericAvroReader(fooV2Schema.getAvroSchema(), fooSchemaNotNull.getAvroSchema(), new byte[10]);\n GenericRecord ge...
{ "fields": [ { "declarator": "reader", "modifier": "private final", "original_string": "private final GenericDatumReader<GenericAvroRecord> reader;", "type": "GenericDatumReader<GenericAvroRecord>", "var_name": "reader" }, { "declarator": "encoder", "modifier": "...
{ "body": "@Override\n public GenericAvroRecord read(byte[] bytes, int offset, int length) {\n try {\n if (offset == 0 && this.offset > 0) {\n offset = this.offset;\n }\n Decoder decoder = DecoderFactory.get().binaryDecoder(bytes, offset, length - offset, null...
{ "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_550
{ "fields": [ { "declarator": "consumer = (key, value) -> new LongPair(key, value)", "modifier": "static final", "original_string": "static final LongPairConsumer<LongPair> consumer = (key, value) -> new LongPair(key, value);", "type": "LongPairConsumer<LongPair>", "var_name": "consu...
{ "body": "@Test\n public void testRangeContaining() {\n ConcurrentOpenLongPairRangeSet<LongPair> set = new ConcurrentOpenLongPairRangeSet<>(consumer);\n set.add(Range.closed(new LongPair(0, 98), new LongPair(0, 99)));\n set.add(Range.closed(new LongPair(0, 100), new LongPair(1, 5)));\n ...
{ "fields": [ { "declarator": "rangeBitSetMap = new ConcurrentSkipListMap<>()", "modifier": "protected final", "original_string": "protected final NavigableMap<Long, BitSet> rangeBitSetMap = new ConcurrentSkipListMap<>();", "type": "NavigableMap<Long, BitSet>", "var_name": "rangeBitS...
{ "body": "@Override\n public Range<T> rangeContaining(long key, long value) {\n BitSet rangeBitSet = rangeBitSetMap.get(key);\n if (rangeBitSet != null) {\n if (!rangeBitSet.get(getSafeEntry(value))) {\n // if position is not part of any range then return null\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_383
{ "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 testValidationKeyWhenBlankSecretKeyIsPassed() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_SECRET_KEY, \" \");\n\n ServiceConfiguration c...
{ "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_229
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionCommonTest.java", "identifier": "FunctionCommonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetSequenceId() {\n long lid = 12345L;\n long eid = 34566L;\n MessageIdImpl id = mock(MessageIdImpl.class);\n when(id.getLedgerId()).thenReturn(lid);\n when(id.getEntryId()).thenReturn(eid);\n\n assertEquals((lid << 28) | eid, FunctionCom...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionCommon.java", "identifier": "FunctionCommon", "interfaces": "", "methods": [ { "class_method_signature": "FunctionCommon.printJson(MessageOrBuilder msg)", "constructor": false, "full_s...
{ "body": "public static final long getSequenceId(MessageId messageId) {\n MessageIdImpl msgId = (MessageIdImpl) ((messageId instanceof TopicMessageIdImpl)\n ? ((TopicMessageIdImpl) messageId).getInnerMessageId()\n : messageId);\n long ledgerId = msgId.getLedgerId();\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_442
{ "fields": [ { "declarator": "channel", "modifier": "protected", "original_string": "protected EmbeddedChannel channel;", "type": "EmbeddedChannel", "var_name": "channel" }, { "declarator": "svcConfig", "modifier": "private", "original_string": "private Ser...
{ "body": "@Test(timeOut = 30000)\n public void testSubscribeTimeout() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Delay the topic creation in a deterministic way\n CompletableFuture<Runnable> openTopicTask = new CompletableFuture<>();\n doAnswer(invocati...
{ "fields": [ { "declarator": "service", "modifier": "private final", "original_string": "private final BrokerService service;", "type": "BrokerService", "var_name": "service" }, { "declarator": "schemaService", "modifier": "private final", "original_string"...
{ "body": "public boolean isActive() {\n return isActive;\n }", "class_method_signature": "ServerCnx.isActive()", "constructor": false, "full_signature": "public boolean isActive()", "identifier": "isActive", "invocations": [], "modifiers": "public", "parameters": "()", "return": "boolean", ...
{ "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_92
{ "fields": [ { "declarator": "writerSchema", "modifier": "private", "original_string": "private GenericAvroSchema writerSchema;", "type": "GenericAvroSchema", "var_name": "writerSchema" }, { "declarator": "readerSchema", "modifier": "private", "original_str...
{ "body": "@Test\n public void testSupportMultiVersioningSupportByDefault() {\n Assert.assertTrue(writerSchema.supportSchemaVersioning());\n Assert.assertTrue(readerSchema.supportSchemaVersioning());\n }", "class_method_signature": "GenericAvroSchemaTest.testSupportMultiVersioningSupportByDefaul...
{ "fields": [ { "declarator": "OFFSET_PROP = \"__AVRO_READ_OFFSET__\"", "modifier": "public final static", "original_string": "public final static String OFFSET_PROP = \"__AVRO_READ_OFFSET__\";", "type": "String", "var_name": "OFFSET_PROP" } ], "file": "pulsar-client/src/main...
{ "body": "@Override\n public boolean supportSchemaVersioning() {\n return true;\n }", "class_method_signature": "GenericAvroSchema.supportSchemaVersioning()", "constructor": false, "full_signature": "@Override public boolean supportSchemaVersioning()", "identifier": "supportSchemaVersioning", ...
{ "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_507
{ "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 testTopicWithBlank() {\n pulsarSourceBuilder.topic(\" \");\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicWithBlank()", "constructor": false, "full_signature": "@Test(expectedExceptions = IllegalA...
{ "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> topic(String... topics) {\n Preconditions.checkArgument(topics != null && topics.length > 0,\n \"topics cannot be blank\");\n for (String topic : topics) {\n Preconditions.checkArgument(StringUtils.isNotBlank(topic), \"topicNames cannot ...
{ "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_157
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/auth/KubernetesSecretsTokenAuthProviderTest.java", "identifier": "KubernetesSecretsTokenAuthProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCacheAuthData() throws ApiException {\n CoreV1Api coreV1Api = mock(CoreV1Api.class);\n doReturn(new V1Secret()).when(coreV1Api).createNamespacedSecret(anyString(), any(), anyString(), anyString(), anyString());\n KubernetesSecretsTokenAuthProvider kubernetesS...
{ "fields": [ { "declarator": "NUM_RETRIES = 5", "modifier": "private static final", "original_string": "private static final int NUM_RETRIES = 5;", "type": "int", "var_name": "NUM_RETRIES" }, { "declarator": "SLEEP_BETWEEN_RETRIES_MS = 500", "modifier": "private ...
{ "body": "@Override\n public Optional<FunctionAuthData> cacheAuthData(Function.FunctionDetails funcDetails,\n AuthenticationDataSource authenticationDataSource) {\n String id = null;\n String tenant = funcDetails.getTenant();\n String namespa...
{ "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_291
{ "fields": [ { "declarator": "localZkS", "modifier": "private", "original_string": "private ZookeeperServerTest localZkS;", "type": "ZookeeperServerTest", "var_name": "localZkS" }, { "declarator": "localZkc", "modifier": "private", "original_string": "priva...
{ "body": "@Test\n public void testZKCreationRW() throws Exception {\n ZooKeeperClientFactory zkf = new ZookeeperClientFactoryImpl();\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"127.0.0.1:\" + localZkS.getZookeeperPort(), SessionType.ReadWrite,\n (int) ZOOKEEPER_SESSION_TIME...
{ "fields": [ { "declarator": "ENCODING_SCHEME = StandardCharsets.UTF_8", "modifier": "public static final", "original_string": "public static final Charset ENCODING_SCHEME = StandardCharsets.UTF_8;", "type": "Charset", "var_name": "ENCODING_SCHEME" }, { "declarator": "...
{ "body": "@Override\n public CompletableFuture<ZooKeeper> create(String serverList, SessionType sessionType, int zkSessionTimeoutMillis) {\n // Create a normal ZK client\n boolean canBeReadOnly = sessionType == SessionType.AllowReadOnly;\n\n CompletableFuture<ZooKeeper> future = new Completab...
{ "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_454
{ "fields": [ { "declarator": "underlyingService", "modifier": "private", "original_string": "private SchemaRegistryService underlyingService;", "type": "SchemaRegistryService", "var_name": "underlyingService" }, { "declarator": "service", "modifier": "private", ...
{ "body": "@Test\n public void testIsCompatibleWithBadSchemaData() {\n String schemaId = \"test-schema-id\";\n SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;\n CompletableFuture<Boolean> future = new CompletableFuture<>();\n when(underlyingService.isCompatible(...
{ "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<Boolean> isCompatible(String schemaId, SchemaData schema, SchemaCompatibilityStrategy strategy) {\n try {\n SchemaDataValidator.validateSchemaData(schema);\n } catch (InvalidSchemaDataException e) {\n return FutureUtil.failedFuture...
{ "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_141
{ "fields": [], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/dlog/DLInputStreamTest.java", "identifier": "DLInputStreamTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRead() throws Exception {\n DistributedLogManager dlm = mock(DistributedLogManager.class);\n LogReader reader = mock(LogReader.class);\n when(dlm.getInputStream(any(DLSN.class))).thenReturn(reader);\n\n byte[] data = \"test-read\".getBytes(UTF_8);\n ...
{ "fields": [ { "declarator": "currentLogRecord = null", "modifier": "private", "original_string": "private LogRecordWithInputStream currentLogRecord = null;", "type": "LogRecordWithInputStream", "var_name": "currentLogRecord" }, { "declarator": "dlm", "modifier":...
{ "body": "@Override\n public int read() throws IOException {\n byte[] b = new byte[1];\n if (read(b, 0, 1) != 1) {\n return -1;\n } else {\n return b[0];\n }\n }", "class_method_signature": "DLInputStream.read()", "constructor": false, "full_signature": "@Override public int read()", ...
{ "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_511
{ "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 testTopicPatternAlreadySet() {\n pulsarSourceBuilder.topicsPattern(Pattern.compile(\"persistent://tenants/ns/topic-*\"));\n pulsarSourceBuilder.topicsPattern(Pattern.compile(\"persistent://tenants/ns/topic-my-*\"));\n...
{ "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> topicsPattern(Pattern topicsPattern) {\n Preconditions.checkArgument(topicsPattern != null, \"Param topicsPattern cannot be null\");\n Preconditions.checkArgument(this.consumerConfigurationData.getTopicsPattern() == null,\n \"Pattern has already been 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_84
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllowNullNestedClasses() {\n JSONSchema<NestedBar> jsonSchema = JSONSchema.of(SchemaDefinition.<NestedBar>builder().withPojo(NestedBar.class).build());\n JSONSchema<NestedBarList> listJsonSchema = JSONSchema.of(SchemaDefinition.<NestedBarList>builder().withPojo(Nest...
{ "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_268
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java", "identifier": "WindowConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSettingWaterMarkInterval() throws Exception {\n final Object[] args = new Object[]{-1L, 0L, 1L, 2L, 5L, 10L, null};\n for (Object arg : args) {\n Object arg0 = arg;\n try {\n Long watermarkEmitInterval = null;\n if...
{ "fields": [ { "declarator": "DEFAULT_MAX_LAG_MS = 0", "modifier": "public static final", "original_string": "public static final long DEFAULT_MAX_LAG_MS = 0;", "type": "long", "var_name": "DEFAULT_MAX_LAG_MS" }, { "declarator": "DEFAULT_WATERMARK_EVENT_INTERVAL_MS = 1...
{ "body": "public static void validate(WindowConfig windowConfig) {\n if (windowConfig.getWindowLengthDurationMs() == null && windowConfig.getWindowLengthCount() == null) {\n throw new IllegalArgumentException(\"Window length is not specified\");\n }\n\n if (windowConfig.getWindowLengt...
{ "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_287
{ "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 testValidateConfig() throws IOException {\n mockStatic(ConnectorUtils.class);\n defn = new ConnectorDefinition();\n defn.setSinkConfigClass(TestSinkConfig.class.getName());\n PowerMockito.when(ConnectorUtils.getConnectorDefinition(any())).thenReturn(defn);...
{ "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 void validateConnectorConfig(SinkConfig sinkConfig, ClassLoader classLoader) {\n try {\n ConnectorDefinition defn = ConnectorUtils.getConnectorDefinition(classLoader);\n if (defn.getSinkConfigClass() != null) {\n Class configClass = Class.forName(de...
{ "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_403
{ "fields": [], "file": "pulsar-discovery-service/src/test/java/org/apache/pulsar/discovery/service/web/ZookeeperCacheLoaderTest.java", "identifier": "ZookeeperCacheLoaderTest", "interfaces": "", "superclass": "extends BaseZKStarterTest" }
{ "body": "@Test\n public void testZookeeperCacheLoader() throws InterruptedException, KeeperException, Exception {\n\n DiscoveryZooKeeperClientFactoryImpl.zk = mockZooKeeper;\n\n @SuppressWarnings(\"resource\")\n ZookeeperCacheLoader zkLoader = new ZookeeperCacheLoader(new DiscoveryZooKeeperC...
{ "fields": [ { "declarator": "localZkCache", "modifier": "private final", "original_string": "private final ZooKeeperCache localZkCache;", "type": "ZooKeeperCache", "var_name": "localZkCache" }, { "declarator": "localZkConnectionSvc", "modifier": "private final",...
{ "body": "public ZookeeperCacheLoader(ZooKeeperClientFactory zkClientFactory, String zookeeperServers,\n int zookeeperSessionTimeoutMs) throws Exception {\n localZkConnectionSvc = new LocalZooKeeperConnectionService(zkClientFactory, zookeeperServers,\n zookeeperSessionTimeoutMs);\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_546
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentSortedLongPairSetTest.java", "identifier": "ConcurrentSortedLongPairSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() {\n\n LongPairSet set = new ConcurrentSortedLongPairSet(16);\n\n set.add(0, 0);\n set.add(1, 1);\n set.add(3, 3);\n final String toString = \"{[0:0], [1:1], [3:3]}\";\n System.out.println(set.toString());\n assertEquals(...
{ "fields": [ { "declarator": "longPairSets = new ConcurrentSkipListMap<>()", "modifier": "protected final", "original_string": "protected final NavigableMap<Long, ConcurrentLongPairSet> longPairSets = new ConcurrentSkipListMap<>();", "type": "NavigableMap<Long, ConcurrentLongPairSet>", ...
{ "body": "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append('{');\n final AtomicBoolean first = new AtomicBoolean(true);\n longPairSets.forEach((key, longPairSet) -> {\n longPairSet.forEach((item1, item2) -> {\n if (!...
{ "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_116
{ "fields": [ { "declarator": "lookup", "modifier": "private", "original_string": "private BinaryProtoLookupService lookup;", "type": "BinaryProtoLookupService", "var_name": "lookup" }, { "declarator": "topicName", "modifier": "private", "original_string": "...
{ "body": "@Test(invocationTimeOut = 3000)\n public void maxLookupRedirectsTest3() throws Exception {\n Field field = BinaryProtoLookupService.class.getDeclaredField(\"maxLookupRedirects\");\n field.setAccessible(true);\n field.set(lookup, 1);\n\n try {\n lookup.getBroker(top...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClientImpl client;", "type": "PulsarClientImpl", "var_name": "client" }, { "declarator": "serviceNameResolver", "modifier": "private final", "origina...
{ "body": "public CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> getBroker(TopicName topicName) {\n return findBroker(serviceNameResolver.resolveHost(), false, topicName, 0);\n }", "class_method_signature": "BinaryProtoLookupService.getBroker(TopicName topicName)", "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_395
{ "fields": [], "file": "pulsar-broker-common/src/test/java/org/apache/pulsar/broker/validator/MultipleListenerValidatorTest.java", "identifier": "MultipleListenerValidatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testListenerWithTLSPort() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setBrokerServicePortTls(Optional.of(6651));\n config.setAdvertisedListeners(\" internal:pulsar://127.0.0.1:6660, internal:pulsar+ssl://127.0.0.1:6651\");\n con...
{ "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_497
{ "fields": [], "file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/JsonSerializationSchemaTest.java", "identifier": "JsonSerializationSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testJsonSerializationSchemaWithSuccessfulCase() throws IOException {\n Employee employee = new Employee(1, \"Test Name\");\n JsonSerializationSchema schema = new JsonSerializationSchema();\n byte[] rowBytes = schema.serialize(employee);\n String jsonConten...
{ "fields": [ { "declarator": "serialVersionUID = -6938065355389311385L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -6938065355389311385L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "map...
{ "body": "@Override\n public byte[] serialize(T t) {\n try {\n return mapper.writeValueAsBytes(t);\n } catch (JsonProcessingException e) {\n throw new RuntimeException(\"Error while serializing the record to Json\", e);\n }\n }", "class_method_signature": "JsonSeria...
{ "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_478
{ "fields": [ { "declarator": "factory = getNamespaceBundleFactory()", "modifier": "private final", "original_string": "private final NamespaceBundleFactory factory = getNamespaceBundleFactory();", "type": "NamespaceBundleFactory", "var_name": "factory" } ], "file": "pulsar-b...
{ "body": "@Test\n public void testCompareTo() throws Exception {\n NamespaceBundle bundle = factory.getBundle(NamespaceName.get(\"pulsar/use/ns1\"),\n Range.range(0l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));\n NamespaceBundle bundle2 = factory.getBundle(NamespaceName.get(\"pul...
{ "fields": [ { "declarator": "nsname", "modifier": "private final", "original_string": "private final NamespaceName nsname;", "type": "NamespaceName", "var_name": "nsname" }, { "declarator": "keyRange", "modifier": "private final", "original_string": "priva...
{ "body": "@Override\n public int compareTo(NamespaceBundle other) {\n if (this.nsname.toString().compareTo(other.nsname.toString()) != 0) {\n return this.nsname.toString().compareTo(other.nsname.toString());\n }\n\n if (equals(other)) {\n // completely the same range, 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_182
{ "fields": [ { "declarator": "config", "modifier": "private", "original_string": "private InstanceConfig config;", "type": "InstanceConfig", "var_name": "config" }, { "declarator": "logger", "modifier": "private", "original_string": "private Logger logger;"...
{ "body": "@Test\n public void testPutStateStateEnabled() throws Exception {\n context.stateContext = mock(StateContextImpl.class);\n ByteBuffer buffer = ByteBuffer.wrap(\"test-value\".getBytes(UTF_8));\n context.putStateAsync(\"test-key\", buffer);\n verify(context.stateContext, times(...
{ "fields": [ { "declarator": "config", "modifier": "private", "original_string": "private InstanceConfig config;", "type": "InstanceConfig", "var_name": "config" }, { "declarator": "logger", "modifier": "private", "original_string": "private Logger logger;"...
{ "body": "@Override\n public CompletableFuture<Void> putStateAsync(String key, ByteBuffer value) {\n ensureStateEnabled();\n return stateContext.put(key, value);\n }", "class_method_signature": "ContextImpl.putStateAsync(String key, ByteBuffer value)", "constructor": false, "full_signature"...
{ "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_47
{ "fields": [ { "declarator": "TEST_ACCESS_TOKEN = \"x.y.z\"", "modifier": "private static final", "original_string": "private static final String TEST_ACCESS_TOKEN = \"x.y.z\";", "type": "String", "var_name": "TEST_ACCESS_TOKEN" }, { "declarator": "TEST_EXPIRES_IN = 60...
{ "body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \".*No.*\")\n public void testConfigureNoParams() throws Exception {\n this.auth.configure(\"\");\n }", "class_method_signature": "AuthenticationOAuth2Test.testConfigureNoParams()", "constructor": ...
{ "fields": [ { "declarator": "CONFIG_PARAM_TYPE = \"type\"", "modifier": "public static final", "original_string": "public static final String CONFIG_PARAM_TYPE = \"type\";", "type": "String", "var_name": "CONFIG_PARAM_TYPE" }, { "declarator": "TYPE_CLIENT_CREDENTIALS ...
{ "body": "@Override\n public void configure(String encodedAuthParamString) {\n if (StringUtils.isBlank(encodedAuthParamString)) {\n throw new IllegalArgumentException(\"No authentication parameters were provided\");\n }\n Map<String, String> params;\n try {\n para...
{ "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_301
{ "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 testNoBucketConfigured() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"s3\");\n conf.setS3ManagedLedgerOffloadRegion(\"eu-west-1\");\n\n try {\n BlobStoreManagedLedgerOffloader.create(c...
{ "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_244
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeDifferentUserConfig() {\n FunctionConfig functionConfig = createFunctionConfig();\n Map<String, String> myConfig = new HashMap<>();\n myConfig.put(\"MyKey\", \"MyValue\");\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"userConf...
{ "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" ...