id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
62117812_269
{ "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 testMergeEqual() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createSinkConfig();\n SinkConfig mergedConfig = SinkConfigUtils.validateUpdate(sinkConfig, newSinkConfig);\n assertEquals(\n new Gson().toJson(sink...
{ "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_286
{ "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 testMergeRuntimeFlags() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newFunctionConfig = createUpdatedSinkConfig(\"runtimeFlags\", \"-Dfoo=bar2\");\n SinkConfig mergedConfig = SinkConfigUtils.validateUpdate(sinkConfig, newFunctionConfig);\n ...
{ "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_455
{ "fields": [ { "declarator": "underlyingService", "modifier": "private", "original_string": "private SchemaRegistryService underlyingService;", "type": "SchemaRegistryService", "var_name": "underlyingService" }, { "declarator": "service", "modifier": "private", ...
{ "body": "@Test\n public void testPutSchemaIfAbsentWithGoodSchemaData() {\n String schemaId = \"test-schema-id\";\n SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;\n CompletableFuture<SchemaVersion> future = new CompletableFuture<>();\n when(underlyingService.p...
{ "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<SchemaVersion> putSchemaIfAbsent(String schemaId,\n SchemaData schema,\n SchemaCompatibilityStrategy strategy) {\n try {\n Sche...
{ "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_140
{ "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 testClose() 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 DLInputStream in = new DLInputStream(dlm);\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 void close() throws IOException {\n reader.close();\n dlm.close();\n }", "class_method_signature": "DLInputStream.close()", "constructor": false, "full_signature": "@Override public void close()", "identifier": "close", "invocations": [ "close", "close" ], "...
{ "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_510
{ "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 testTopicPatternWithNull() {\n pulsarSourceBuilder.topicsPattern(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicPatternWithNull()", "constructor": false, "full_signature": "@Test(expectedEx...
{ "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_85
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAllowNullNestedClasses() {\n JSONSchema<NestedBar> jsonSchema = JSONSchema.of(SchemaDefinition.<NestedBar>builder().withPojo(NestedBar.class).withAlwaysAllowNull(false).build());\n JSONSchema<NestedBarList> listJsonSchema = JSONSchema.of(SchemaDefinition.<NestedB...
{ "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_290
{ "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 testZKCreationFailure() throws Exception {\n ZooKeeperClientFactory zkf = new ZookeeperBkClientFactoryImpl(executor);\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"invalid\", SessionType.ReadWrite,\n (int) ZOOKEEPER_SESSION_TIMEOUT_MILLIS);\n\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ZookeeperBkClientFactoryImpl.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ZookeeperBkClientFactoryImpl.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public CompletableFuture<ZooKeeper> create(String serverList, SessionType sessionType, int zkSessionTimeoutMillis) {\n CompletableFuture<ZooKeeper> future = new CompletableFuture<>();\n\n executor.execute(safeRun(() -> {\n try {\n ZooKeeper zk = ZooKee...
{ "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_443
{ "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 testProducerSuccessOnEncryptionRequiredTopic() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Set encryption_required to true\n ZooKeeperDataCache<Policies> zkDataCache = mock(ZooKeeperDataCache.class);\n Polic...
{ "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 ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers() {\n return producers;\n }", "class_method_signature": "ServerCnx.getProducers()", "constructor": false, "full_signature": "public ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers()", "identifier": "get...
{ "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_93
{ "fields": [ { "declarator": "writerSchema", "modifier": "private", "original_string": "private GenericAvroSchema writerSchema;", "type": "GenericAvroSchema", "var_name": "writerSchema" }, { "declarator": "readerSchema", "modifier": "private", "original_str...
{ "body": "@Test(expectedExceptions = org.apache.pulsar.client.api.SchemaSerializationException.class)\n public void testFailDecodeWithoutMultiVersioningSupport() {\n GenericRecord dataForWriter = writerSchema.newRecordBuilder()\n .set(\"field1\", SchemaTestUtils.TEST_MULTI_VERSION_SCHEMA_STRING)...
{ "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 GenericRecordBuilder newRecordBuilder() {\n return new AvroRecordBuilderImpl(this);\n }", "class_method_signature": "GenericAvroSchema.newRecordBuilder()", "constructor": false, "full_signature": "@Override public GenericRecordBuilder newRecordBuilder()", "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_506
{ "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 testTopicWithNull() {\n pulsarSourceBuilder.topic(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicWithNull()", "constructor": false, "full_signature": "@Test(expectedExceptions = IllegalArgu...
{ "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_156
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/auth/KubernetesSecretsTokenAuthProviderTest.java", "identifier": "KubernetesSecretsTokenAuthProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigureAuthDataStatefulSet() {\n byte[] testBytes = new byte[]{0, 1, 2, 3, 4};\n\n CoreV1Api coreV1Api = mock(CoreV1Api.class);\n KubernetesSecretsTokenAuthProvider kubernetesSecretsTokenAuthProvider = new KubernetesSecretsTokenAuthProvider();\n kube...
{ "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 void configureAuthDataStatefulSet(V1StatefulSet statefulSet, Optional<FunctionAuthData> functionAuthData) {\n if (!functionAuthData.isPresent()) {\n return;\n }\n\n V1PodSpec podSpec = statefulSet.getSpec().getTemplate().getSpec();\n\n // configu...
{ "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_382
{ "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 = AuthenticationException.class)\n public void testAuthenticateWhenJwtIsBlank() throws AuthenticationException {\n AuthenticationProviderToken provider = new AuthenticationProviderToken();\n provider.authenticate(new AuthenticationDataSource() {\n @Overr...
{ "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 String authenticate(AuthenticationDataSource authData) throws AuthenticationException {\n // Get Token\n String token = getToken(authData);\n\n // Parse Token by validating\n return getPrincipal(authenticateToken(token));\n }", "class_method_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_228
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionCommonTest.java", "identifier": "FunctionCommonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDownloadFile() throws Exception {\n String jarHttpUrl = \"https://repo1.maven.org/maven2/org/apache/pulsar/pulsar-common/2.4.2/pulsar-common-2.4.2.jar\";\n String testDir = FunctionCommonTest.class.getProtectionDomain().getCodeSource().getLocation().getPath();\n ...
{ "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 void downloadFromHttpUrl(String destPkgUrl, File targetFile) throws IOException {\n URL website = new URL(destPkgUrl);\n\n ReadableByteChannel rbc = Channels.newChannel(website.openStream());\n log.info(\"Downloading function package from {} to {} ...\", destPkgUrl, targe...
{ "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_414
{ "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 testStart() {\n BrokerService service = mock(BrokerService.class);\n handlers.start(service);\n verify(handler1, times(1)).start(same(service));\n verify(handler2, times(1)).start(same(service));\n }", "class_method_signature": "ProtocolHandlersTest.t...
{ "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 start(BrokerService service) {\n handlers.values().forEach(handler -> handler.start(service));\n }", "class_method_signature": "ProtocolHandlers.start(BrokerService service)", "constructor": false, "full_signature": "public void start(BrokerService service)", "identifier": "st...
{ "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_101
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecordTest.java", "identifier": "GenericJsonRecordTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void decodeLongField() throws Exception{\n String jsonStr = \"{\\\"timestamp\\\":1585204833128, \\\"count\\\":2, \\\"value\\\": 1.1, \\\"on\\\":true}\";\n byte[] jsonStrBytes = jsonStr.getBytes();\n ObjectMapper objectMapper = new ObjectMapper();\n JsonNode jn ...
{ "fields": [ { "declarator": "jn", "modifier": "private final", "original_string": "private final JsonNode jn;", "type": "JsonNode", "var_name": "jn" }, { "declarator": "schemaInfo", "modifier": "private final", "original_string": "private final SchemaInfo ...
{ "body": "@Override\n public Object getField(String fieldName) {\n JsonNode fn = jn.get(fieldName);\n if (fn.isContainerNode()) {\n AtomicInteger idx = new AtomicInteger(0);\n List<Field> fields = Lists.newArrayList(fn.fieldNames())\n .stream()\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_551
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentOpenHashSetTest.java", "identifier": "ConcurrentOpenHashSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemove() {\n ConcurrentOpenHashSet<String> set = new ConcurrentOpenHashSet<>();\n\n assertTrue(set.isEmpty());\n assertTrue(set.add(\"1\"));\n assertFalse(set.isEmpty());\n\n assertFalse(set.remove(\"0\"));\n assertFalse(set.isEmpty());\n...
{ "fields": [ { "declarator": "EmptyValue = null", "modifier": "private static final", "original_string": "private static final Object EmptyValue = null;", "type": "Object", "var_name": "EmptyValue" }, { "declarator": "DeletedValue = new Object()", "modifier": "pr...
{ "body": "public boolean remove(V value) {\n checkNotNull(value);\n long h = hash(value);\n return getSection(h).remove(value, (int) h);\n }", "class_method_signature": "ConcurrentOpenHashSet.remove(V value)", "constructor": false, "full_signature": "public boolean remove(V value)", "...
{ "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_250
{ "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 = \"Subscription Name cannot be altered\")\n public void testMergeDifferentSubname() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunc...
{ "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_315
{ "fields": [ { "declarator": "LOCALHOST = \"127.0.0.1\"", "modifier": "private static final", "original_string": "private static final String LOCALHOST = \"127.0.0.1\";", "type": "String", "var_name": "LOCALHOST" }, { "declarator": "TCP = \"tcp\"", "modifier": "p...
{ "body": "@Test\n public void testNettyTcpConfigLoadWithYamlFile() throws IOException {\n File yamlFile = getFile(\"nettySourceConfig.yaml\");\n NettySourceConfig nettySourceConfig = NettySourceConfig.load(yamlFile.getAbsolutePath());\n assertNotNull(nettySourceConfig);\n assertEquals(...
{ "fields": [ { "declarator": "serialVersionUID = -7116130435021510496L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -7116130435021510496L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "typ...
{ "body": "public static NettySourceConfig load(Map<String, Object> map) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n return mapper.readValue(new ObjectMapper().writeValueAsString(map), NettySourceConfig.class);\n }", "class_method_signature": "NettySourceConfig.load(Map<Strin...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_196
{ "fields": [ { "declarator": "testBatchSource", "modifier": "private", "original_string": "private TestBatchSource testBatchSource;", "type": "TestBatchSource", "var_name": "testBatchSource" }, { "declarator": "testBatchPushSource", "modifier": "private", "...
{ "body": "@Test\n public void testOpenWithRightSource() throws Exception {\n batchSourceExecutor.open(config, context);\n }", "class_method_signature": "BatchSourceExecutorTest.testOpenWithRightSource()", "constructor": false, "full_signature": "@Test public void testOpenWithRightSource()", "identifier"...
{ "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_53
{ "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\n public void testClose() throws Exception {\n this.auth.close();\n verify(this.flow).close();\n }", "class_method_signature": "AuthenticationOAuth2Test.testClose()", "constructor": false, "full_signature": "@Test public void testClose()", "identifier": "testClose", "inv...
{ "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 close() throws IOException {\n try {\n flow.close();\n } catch (Exception e) {\n throw new IOException(e);\n }\n }", "class_method_signature": "AuthenticationOAuth2.close()", "constructor": false, "full_signature": "@Override pu...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_179
{ "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(expectedExceptions = IllegalStateException.class)\n public void testPutStateStateDisabled() {\n context.putState(\"test-key\", ByteBuffer.wrap(\"test-value\".getBytes(UTF_8)));\n }", "class_method_signature": "ContextImplTest.testPutStateStateDisabled()", "constructor": false, "ful...
{ "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 void putState(String key, ByteBuffer value) {\n ensureStateEnabled();\n try {\n result(stateContext.put(key, value));\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to update the state value for key '\" + key + \"'\");\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_483
{ "fields": [ { "declarator": "factory = getNamespaceBundleFactory()", "modifier": "private final", "original_string": "private final NamespaceBundleFactory factory = getNamespaceBundleFactory();", "type": "NamespaceBundleFactory", "var_name": "factory" }, { "declarator...
{ "body": "@Test\n public void testSplitBundleByFixBoundary() throws Exception {\n NamespaceName nsname = NamespaceName.get(\"pulsar/global/ns1\");\n NamespaceBundles bundles = factory.getBundles(nsname);\n NamespaceBundle bundleToSplit = bundles.getBundles().get(0);\n\n try {\n ...
{ "fields": [ { "declarator": "nsname", "modifier": "private final", "original_string": "private final NamespaceName nsname;", "type": "NamespaceName", "var_name": "nsname" }, { "declarator": "bundles", "modifier": "private final", "original_string": "privat...
{ "body": "public List<NamespaceBundle> getBundles() {\n return bundles;\n }", "class_method_signature": "NamespaceBundles.getBundles()", "constructor": false, "full_signature": "public List<NamespaceBundle> getBundles()", "identifier": "getBundles", "invocations": [], "modifiers": "public", "...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_529
{ "fields": [ { "declarator": "classLoader", "modifier": "private final", "original_string": "private final ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" } ], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/ReflectionsTest.java...
{ "body": "@Test\n public void testCreateTypedInstanceAbstractClass() {\n try {\n createInstance(AbstractClass.class.getName(), aInterface.class, classLoader);\n fail(\"Should fail to load abstract class\");\n } catch (RuntimeException re) {\n assertTrue(re.getCause()...
{ "fields": [ { "declarator": "constructorCache =\n new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<Class<?>, Constructor<?>> constructorCache =\n new ConcurrentHashMap<>();", "type": "Map<Class<?>, Constructor<?>>"...
{ "body": "public static <T> T createInstance(String userClassName,\n Class<T> xface,\n ClassLoader classLoader) {\n Class<?> theCls;\n try {\n theCls = Class.forName(userClassName, true, classLoader);\n } catc...
{ "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_207
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtilsTest.java", "identifier": "FunctionMetaDataUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCanChangeState() {\n\n long version = 5;\n Function.FunctionMetaData metaData = Function.FunctionMetaData.newBuilder().setFunctionDetails(\n Function.FunctionDetails.newBuilder().setName(\"func-1\").setParallelism(2)).setVersion(version).build();\n\n ...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtils.java", "identifier": "FunctionMetaDataUtils", "interfaces": "", "methods": [ { "class_method_signature": "FunctionMetaDataUtils.canChangeState(Function.FunctionMetaData functionMetaD...
{ "body": "public static boolean canChangeState(Function.FunctionMetaData functionMetaData, int instanceId, Function.FunctionState newState) {\n if (instanceId >= functionMetaData.getFunctionDetails().getParallelism()) {\n return false;\n }\n if (functionMetaData.getInstanceStatesMap()...
{ "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_0
{ "fields": [], "file": "pulsar-client-kafka-compat/pulsar-client-kafka_0_9/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java", "identifier": "PulsarKafkaProducerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPulsarKafkaProducer() {\n ClientBuilder mockClientBuilder = mock(ClientBuilder.class);\n ProducerBuilder mockProducerBuilder = mock(ProducerBuilder.class);\n doAnswer(invocation -> {\n Assert.assertEquals((int)invocation.getArguments()[0], 1000000,...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClient client;", "type": "PulsarClient", "var_name": "client" }, { "declarator": "pulsarProducerBuilder", "modifier": "private final", "original_stri...
{ "body": "public PulsarKafkaProducer(Map<String, Object> configs) {\n this(new ProducerConfig(configs), null, null);\n }", "class_method_signature": "PulsarKafkaProducer.PulsarKafkaProducer(Map<String, Object> configs)", "constructor": true, "full_signature": "public PulsarKafkaProducer(Map<String, ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_342
{ "fields": [ { "declarator": "TESTFILE = new File(\n TestEnvVarResolverProperties.class.getClassLoader()\n .getResource(\"flume-conf-with-envvars.properties\").getFile())", "modifier": "private static final", "original_string": "private static final File TESTFILE =...
{ "body": "@Test\n public void getProperty() throws Exception {\n String NC_PORT = \"6667\";\n environmentVariables.set(\"NC_PORT\", NC_PORT);\n System.setProperty(\"propertiesImplementation\",\n \"org.apache.pulsar.io.flume.node.EnvVarResolverProperties\");\n\n Assert.as...
{ "fields": [], "file": "pulsar-io/flume/src/main/java/org/apache/pulsar/io/flume/node/EnvVarResolverProperties.java", "identifier": "EnvVarResolverProperties", "interfaces": "", "methods": [ { "class_method_signature": "EnvVarResolverProperties.resolveEnvVars(String input)", "constructor": fa...
{ "body": "@Override\n public String getProperty(String key) {\n return resolveEnvVars(super.getProperty(key));\n }", "class_method_signature": "EnvVarResolverProperties.getProperty(String key)", "constructor": false, "full_signature": "@Override public String getProperty(String key)", "identifie...
{ "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_591
{ "fields": [ { "declarator": "ml1", "modifier": "", "original_string": "ManagedLedgerImpl ml1;", "type": "ManagedLedgerImpl", "var_name": "ml1" }, { "declarator": "ml2", "modifier": "", "original_string": "ManagedLedgerImpl ml2;", "type": "ManagedLedg...
{ "body": "@Test\n public void verifyNoCacheIfNoConsumer() throws Exception {\n ManagedLedgerFactoryConfig config = new ManagedLedgerFactoryConfig();\n config.setMaxCacheSize(7 * 10);\n config.setCacheEvictionWatermark(0.8);\n\n factory = new ManagedLedgerFactoryImpl(bkc, bkc.getZkHandl...
{ "fields": [ { "declarator": "maxSize", "modifier": "private final", "original_string": "private final long maxSize;", "type": "long", "var_name": "maxSize" }, { "declarator": "evictionTriggerThreshold", "modifier": "private final", "original_string": "priv...
{ "body": "public long getSize() {\n return currentSize.get();\n }", "class_method_signature": "EntryCacheManager.getSize()", "constructor": false, "full_signature": "public long getSize()", "identifier": "getSize", "invocations": [ "get" ], "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_211
{ "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 testBatchConfigMergeEqual() {\n SourceConfig sourceConfig = createSourceConfigWithBatch();\n SourceConfig newSourceConfig = createSourceConfigWithBatch();\n SourceConfig mergedConfig = SourceConfigUtils.validateUpdate(sourceConfig, newSourceConfig);\n asse...
{ "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_354
{ "fields": [], "file": "pulsar-io/kinesis/src/test/java/org/apache/pulsar/io/kinesis/UtilsTest.java", "identifier": "UtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(dataProvider=\"encryption\")\n public void testFbSerialization(boolean isEncryption) throws Exception {\n\n final String[] keyNames = { \"key1\", \"key2\" };\n final String param = \"param\";\n final String algo = \"algo\";\n int batchSize = 10;\n int compression...
{ "fields": [ { "declarator": "PAYLOAD_FIELD = \"payloadBase64\"", "modifier": "private static final", "original_string": "private static final String PAYLOAD_FIELD = \"payloadBase64\";", "type": "String", "var_name": "PAYLOAD_FIELD" }, { "declarator": "PROPERTIES_FIELD...
{ "body": "public static ByteBuffer serializeRecordToFlatBuffer(Record<byte[]> record) {\n DEFAULT_FB_BUILDER.clear();\n return serializeRecordToFlatBuffer(DEFAULT_FB_BUILDER, record);\n }", "class_method_signature": "Utils.serializeRecordToFlatBuffer(Record<byte[]> record)", "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_587
{ "fields": [], "file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/util/RangeCacheTest.java", "identifier": "RangeCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getRange() {\n RangeCache<Integer, RefString> cache = new RangeCache<>();\n\n cache.put(0, new RefString(\"0\"));\n cache.put(1, new RefString(\"1\"));\n cache.put(3, new RefString(\"3\"));\n cache.put(5, new RefString(\"5\"));\n\n assertEqua...
{ "fields": [ { "declarator": "entries", "modifier": "private final", "original_string": "private final ConcurrentNavigableMap<Key, Value> entries;", "type": "ConcurrentNavigableMap<Key, Value>", "var_name": "entries" }, { "declarator": "size", "modifier": "privat...
{ "body": "public Collection<Value> getRange(Key first, Key last) {\n List<Value> values = Lists.newArrayList();\n\n // Return the values of the entries found in cache\n for (Value value : entries.subMap(first, true, last, true).values()) {\n try {\n value.retain();\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_12
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImplTest.java", "identifier": "MultiTopicsConsumerImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetStats() throws Exception {\n String topicName = \"test-stats\";\n ClientConfigurationData conf = new ClientConfigurationData();\n conf.setServiceUrl(\"pulsar://localhost:6650\");\n conf.setStatsIntervalSeconds(100);\n\n ThreadFactory threadFa...
{ "fields": [ { "declarator": "DUMMY_TOPIC_NAME_PREFIX = \"MultiTopicsConsumer-\"", "modifier": "public static final", "original_string": "public static final String DUMMY_TOPIC_NAME_PREFIX = \"MultiTopicsConsumer-\";", "type": "String", "var_name": "DUMMY_TOPIC_NAME_PREFIX" }, ...
{ "body": "@Override\n public synchronized ConsumerStats getStats() {\n if (stats == null) {\n return null;\n }\n stats.reset();\n\n consumers.values().stream().forEach(consumer -> stats.updateCumulativeStats(consumer.getStats()));\n return stats;\n }", "class_met...
{ "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_138
{ "fields": [], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/dlog/DLOutputStreamTest.java", "identifier": "DLOutputStreamTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWrite() throws Exception {\n DistributedLogManager dlm = mock(DistributedLogManager.class);\n AppendOnlyStreamWriter writer = mock(AppendOnlyStreamWriter.class);\n DLOutputStream out = new DLOutputStream(dlm, writer);\n\n byte[] data = new byte[16];\n ...
{ "fields": [ { "declarator": "dlm", "modifier": "private final", "original_string": "private final DistributedLogManager dlm;", "type": "DistributedLogManager", "var_name": "dlm" }, { "declarator": "writer", "modifier": "private final", "original_string": "...
{ "body": "@Override\n public void write(int b) throws IOException {\n byte[] data = new byte[] {\n (byte) b\n };\n write(data);\n }", "class_method_signature": "DLOutputStream.write(int b)", "constructor": false, "full_signature": "@Override public void write(int b)", "identifier": "write",...
{ "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_568
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/AutoTopicCreationOverrideTest.java", "identifier": "AutoTopicCreationOverrideTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInvalidTopicType() {\n AutoTopicCreationOverride override = new AutoTopicCreationOverride(true, \"aaa\", null);\n assertFalse(AutoTopicCreationOverride.isValidOverride(override));\n }", "class_method_signature": "AutoTopicCreationOverrideTest.testInvalidTopicTy...
{ "fields": [ { "declarator": "allowAutoTopicCreation", "modifier": "public", "original_string": "public boolean allowAutoTopicCreation;", "type": "boolean", "var_name": "allowAutoTopicCreation" }, { "declarator": "topicType", "modifier": "public", "original...
{ "body": "public static boolean isValidOverride(AutoTopicCreationOverride override) {\n if (override == null) {\n return false;\n }\n if (override.allowAutoTopicCreation) {\n if (!TopicType.isValidTopicType(override.topicType)) {\n return false;\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_246
{ "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 = \"Runtime cannot be altered\")\n public void testMergeDifferentRuntime() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig...
{ "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_303
{ "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 testGcsNoKeyPath() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"google-cloud-storage\");\n conf.setGcsManagedLedgerOffloadBucket(BUCKET);\n\n try {\n BlobStoreManagedLedgerOffloader.cr...
{ "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_45
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/ClientCnxTest.java", "identifier": "ClientCnxTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testClientCnxTimeout() throws Exception {\n EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(1, new DefaultThreadFactory(\"testClientCnxTimeout\"));\n ClientConfigurationData conf = new ClientConfigurationData();\n conf.setOperationTimeoutMs(10);\n ...
{ "fields": [ { "declarator": "authentication", "modifier": "protected final", "original_string": "protected final Authentication authentication;", "type": "Authentication", "var_name": "authentication" }, { "declarator": "state", "modifier": "private", "ori...
{ "body": "public CompletableFuture<LookupDataResult> newLookup(ByteBuf request, long requestId) {\n CompletableFuture<LookupDataResult> future = new CompletableFuture<>();\n\n if (pendingLookupRequestSemaphore.tryAcquire()) {\n addPendingLookupRequests(requestId, future);\n ctx.wr...
{ "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_180
{ "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(expectedExceptions = IllegalStateException.class)\n public void testDeleteStateStateDisabled() {\n context.deleteState(\"test-key\");\n }", "class_method_signature": "ContextImplTest.testDeleteStateStateDisabled()", "constructor": false, "full_signature": "@Test(expectedExceptions ...
{ "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 void deleteState(String key) {\n ensureStateEnabled();\n try {\n result(stateContext.delete(key));\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to delete the state value for key '\" + key + \"'\");\n }\n }", "cl...
{ "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_495
{ "fields": [], "file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/CsvSerializationSchemaTest.java", "identifier": "CsvSerializationSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCsvSerializationSchemaWithSuccessfulCase() throws IOException {\n Tuple3<Integer, String, String> employee = new Tuple3(1, \"Wolfgang Amadeus\", \"Mozart\");\n CsvSerializationSchema schema = new CsvSerializationSchema();\n byte[] rowBytes = schema.serialize(...
{ "fields": [ { "declarator": "serialVersionUID = -3379119592495232636L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3379119592495232636L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "STR...
{ "body": "@Override\n public byte[] serialize(T t) {\n StringWriter stringWriter;\n try {\n Object[] fieldsValues = new Object[t.getArity()];\n for (int index = 0; index < t.getArity(); index++) {\n fieldsValues[index] = (t.getField(index));\n }\n\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_378
{ "fields": [ { "declarator": "auth", "modifier": "private", "original_string": "private AuthenticationAthenz auth;", "type": "AuthenticationAthenz", "var_name": "auth" }, { "declarator": "TENANT_DOMAIN = \"test_tenant\"", "modifier": "private static final", ...
{ "body": "@Test\n public void testGetAuthData() throws Exception {\n\n com.yahoo.athenz.auth.token.RoleToken roleToken = new com.yahoo.athenz.auth.token.RoleToken(\n auth.getAuthData().getCommandData());\n assertEquals(roleToken.getPrincipal(), String.format(\"%s.%s\", TENANT_DOMAIN, ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "APPLICATION_X_PEM_FILE = \"application/x-...
{ "body": "@Override\n synchronized public AuthenticationDataProvider getAuthData() throws PulsarClientException {\n if (cachedRoleTokenIsValid()) {\n return new AuthenticationDataAthenz(roleToken, isNotBlank(roleHeader) ? roleHeader : ZTSClient.getHeader());\n }\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_397
{ "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 testWithoutListenerNameInAdvertisedListeners() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setBrokerServicePortTls(Optional.of(6651));\n config.setAdvertisedListeners(\" internal:puls...
{ "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_544
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentSortedLongPairSetTest.java", "identifier": "ConcurrentSortedLongPairSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemove() {\n LongPairSet set = new ConcurrentSortedLongPairSet(16);\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 assert...
{ "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 boolean remove(long item1, long item2) {\n ConcurrentLongPairSet messagesToReplay = longPairSets.get(item1);\n if (messagesToReplay != null) {\n boolean removed = messagesToReplay.remove(item1, item2);\n if (messagesToReplay.isEmpty() && longPairSet...
{ "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_114
{ "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 maxLookupRedirectsTest1() throws Exception {\n Pair<InetSocketAddress, InetSocketAddress> addressPair = lookup.getBroker(topicName).get();\n assertEquals(addressPair.getLeft().toString(), \"broker2.pulsar.apache.org:6650\");\n assertEqua...
{ "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_401
{ "fields": [], "file": "pulsar-broker-common/src/test/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoaderTest.java", "identifier": "PulsarConfigurationLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testComplete() throws Exception {\n TestCompleteObject complete = this.new TestCompleteObject();\n assertTrue(isComplete(complete));\n }", "class_method_signature": "PulsarConfigurationLoaderTest.testComplete()", "constructor": false, "full_signature": "@Test p...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarConfigurationLoader.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarConfigurationLoader.class);", "type": "Logger", "var_name": "log" ...
{ "body": "public static boolean isComplete(Object obj) throws IllegalArgumentException {\n checkNotNull(obj);\n Field[] fields = obj.getClass().getDeclaredFields();\n StringBuilder error = new StringBuilder();\n for (Field field : fields) {\n if (field.isAnnotationPresent(Field...
{ "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_285
{ "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 testMergeDifferentTimeout() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"timeoutMs\", 102l);\n SinkConfig mergedConfig = SinkConfigUtils.validateUpdate(sinkConfig, newSinkConfig);\n assertEquals(\n ...
{ "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_86
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAllowNullCorrectPolymorphism() {\n Bar bar = new Bar();\n bar.setField1(true);\n\n DerivedFoo derivedFoo = new DerivedFoo();\n derivedFoo.setField1(\"foo1\");\n derivedFoo.setField2(\"bar2\");\n derivedFoo.setField3(4);\n derive...
{ "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_143
{ "fields": [], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/FunctionActionerTest.java", "identifier": "FunctionActionerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStartFunctionWithPkgUrl() throws Exception {\n\n WorkerConfig workerConfig = new WorkerConfig();\n workerConfig.setWorkerId(\"worker-1\");\n workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());\n workerConfig.setFuncti...
{ "fields": [ { "declarator": "workerConfig", "modifier": "private final", "original_string": "private final WorkerConfig workerConfig;", "type": "WorkerConfig", "var_name": "workerConfig" }, { "declarator": "runtimeFactory", "modifier": "private final", "or...
{ "body": "public void startFunction(FunctionRuntimeInfo functionRuntimeInfo) {\n try {\n FunctionMetaData functionMetaData = functionRuntimeInfo.getFunctionInstance().getFunctionMetaData();\n FunctionDetails functionDetails = functionMetaData.getFunctionDetails();\n int instan...
{ "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_513
{ "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 testSubscriptionNameWithNull() {\n pulsarSourceBuilder.subscriptionName(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testSubscriptionNameWithNull()", "constructor": false, "full_signature": "@Test...
{ "fields": [ { "declarator": "SERVICE_URL = \"pulsar://localhost:6650\"", "modifier": "private static final", "original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";", "type": "String", "var_name": "SERVICE_URL" }, { "declarator": "AC...
{ "body": "public PulsarSourceBuilder<T> subscriptionName(String subscriptionName) {\n Preconditions.checkArgument(StringUtils.isNotBlank(subscriptionName),\n \"subscriptionName cannot be blank\");\n this.consumerConfigurationData.setSubscriptionName(subscriptionName);\n return thi...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_456
{ "fields": [ { "declarator": "underlyingService", "modifier": "private", "original_string": "private SchemaRegistryService underlyingService;", "type": "SchemaRegistryService", "var_name": "underlyingService" }, { "declarator": "service", "modifier": "private", ...
{ "body": "@Test\n public void testPutSchemaIfAbsentWithBadSchemaData() {\n String schemaId = \"test-schema-id\";\n SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;\n CompletableFuture<SchemaVersion> future = new CompletableFuture<>();\n when(underlyingService.pu...
{ "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<SchemaVersion> putSchemaIfAbsent(String schemaId,\n SchemaData schema,\n SchemaCompatibilityStrategy strategy) {\n try {\n Sche...
{ "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_69
{ "fields": [ { "declarator": "FOO_PROPERTIES = new HashMap() {\n\n private static final long serialVersionUID = 58641844834472929L;\n\n {\n put(\"foo1\", \"foo-value1\");\n put(\"foo2\", \"foo-value2\");\n put(\"foo3\", \"foo-value3\");\n }\n\n }", ...
{ "body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testDecodeNonKeyValueSchemaInfo() {\n DefaultImplementation.decodeKeyValueSchemaInfo(\n FOO_SCHEMA.getSchemaInfo()\n );\n }", "class_method_signature": "KeyValueSchemaInfoTest.testDecodeNonKeyValueSche...
{ "fields": [ { "declarator": "SCHEMA_INFO_WRITER = new Schema<SchemaInfo>() {\n @Override\n public byte[] encode(SchemaInfo si) {\n return si.getSchema();\n }\n\n @Override\n public SchemaInfo getSchemaInfo() {\n return BytesSchema.BYTES.getSchemaInf...
{ "body": "public static KeyValue<SchemaInfo, SchemaInfo> decodeKeyValueSchemaInfo(SchemaInfo schemaInfo) {\n checkArgument(SchemaType.KEY_VALUE == schemaInfo.getType(),\n \"Not a KeyValue schema\");\n\n return KeyValue.decode(\n schemaInfo.getSchema(),\n (keyBytes, valu...
{ "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_339
{ "fields": [ { "declarator": "LOGGER =\n LoggerFactory.getLogger(TestPropertiesFileConfigurationProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER =\n LoggerFactory.getLogger(TestPropertiesFileConfigurationProvider....
{ "body": "@Test\n public void testPropertyRead() throws Exception {\n\n FlumeConfiguration configuration = provider.getFlumeConfiguration();\n Assert.assertNotNull(configuration);\n\n /*\n * Test the known errors in the file\n */\n List<String> expected = Lists.newArrayList();\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory\n .getLogger(PropertiesFileConfigurationProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory\n .getLogger(PropertiesFileConfigurationProvider.class)...
{ "body": "@Override\n public FlumeConfiguration getFlumeConfiguration() {\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new FileReader(file));\n String resolverClassName = System.getProperty(\"propertiesImplementation\",\n DEFAULT_PROP...
{ "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_293
{ "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 testZKCreationFailure() throws Exception {\n ZooKeeperClientFactory zkf = new ZookeeperClientFactoryImpl();\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"invalid\", SessionType.ReadWrite,\n (int) ZOOKEEPER_SESSION_TIMEOUT_MILLIS);\n\n try ...
{ "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_505
{ "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 testServiceUrlWithBlank() {\n pulsarSourceBuilder.serviceUrl(\" \");\n }", "class_method_signature": "PulsarSourceBuilderTest.testServiceUrlWithBlank()", "constructor": false, "full_signature": "@Test(expectedExcept...
{ "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> serviceUrl(String serviceUrl) {\n Preconditions.checkArgument(StringUtils.isNotBlank(serviceUrl), \"serviceUrl cannot be blank\");\n this.clientConfigurationData.setServiceUrl(serviceUrl);\n return this;\n }", "class_method_signature": "PulsarSourceBu...
{ "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_155
{ "fields": [ { "declarator": "TEST_TENANT = \"tenant\"", "modifier": "private static final", "original_string": "private static final String TEST_TENANT = \"tenant\";", "type": "String", "var_name": "TEST_TENANT" }, { "declarator": "TEST_NAMESPACE = \"namespace\"", ...
{ "body": "@Test\n public void testCustomKubernetesManifestCustomizer() throws Exception {\n InstanceConfig config = createJavaInstanceConfig(FunctionDetails.Runtime.JAVA, false);\n config.setFunctionDetails(createFunctionDetails(FunctionDetails.Runtime.JAVA, false, (fb) -> {\n return fb.s...
{ "fields": [ { "declarator": "ENV_SHARD_ID = \"SHARD_ID\"", "modifier": "private static final", "original_string": "private static final String ENV_SHARD_ID = \"SHARD_ID\";", "type": "String", "var_name": "ENV_SHARD_ID" }, { "declarator": "maxJobNameSize = 55", "...
{ "body": "@VisibleForTesting\n V1StatefulSet createStatefulSet() {\n final String jobName = createJobName(instanceConfig.getFunctionDetails());\n\n final V1StatefulSet statefulSet = new V1StatefulSet();\n\n // setup stateful set metadata\n final V1ObjectMeta objectMeta = new V1ObjectMe...
{ "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_90
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDecodeByteBuf() {\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 foo1.setF...
{ "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_440
{ "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, enabled = false)\n public void testCreateProducerMultipleTimeouts() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Delay the topic creation in a deterministic way\n CountDownLatch topicCreationDelayLatch = new CountDownLatch(1);\n ...
{ "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_381
{ "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 = AuthenticationException.class)\n public void testAuthenticateWhenAuthHeaderValuePrefixIsInvalid() throws AuthenticationException {\n AuthenticationProviderToken provider = new AuthenticationProviderToken();\n provider.authenticate(new AuthenticationDataSource() {...
{ "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 String authenticate(AuthenticationDataSource authData) throws AuthenticationException {\n // Get Token\n String token = getToken(authData);\n\n // Parse Token by validating\n return getPrincipal(authenticateToken(token));\n }", "class_method_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_102
{ "fields": [ { "declarator": "NAME = \"foo\"", "modifier": "private static final", "original_string": "private static final String NAME = \"foo\";", "type": "String", "var_name": "NAME" }, { "declarator": "EXPECTED_SCHEMA_JSON = \"{\\\"type\\\":\\\"record\\\",\\\"name\...
{ "body": "@Test\n public void testEncodeAndDecode() {\n Function.FunctionDetails functionDetails = Function.FunctionDetails.newBuilder().setName(NAME).build();\n\n ProtobufSchema<Function.FunctionDetails> protobufSchema = ProtobufSchema.of(Function.FunctionDetails.class);\n\n byte[] bytes = p...
{ "fields": [ { "declarator": "PARSING_INFO_PROPERTY = \"__PARSING_INFO__\"", "modifier": "public static final", "original_string": "public static final String PARSING_INFO_PROPERTY = \"__PARSING_INFO__\";", "type": "String", "var_name": "PARSING_INFO_PROPERTY" } ], "file": "...
{ "body": "public static <T extends com.google.protobuf.GeneratedMessageV3> ProtobufSchema<T> of(Class<T> pojo) {\n return of(pojo, new HashMap<>());\n }", "class_method_signature": "ProtobufSchema.of(Class<T> pojo)", "constructor": false, "full_signature": "public static ProtobufSchema<T> of(Class<T>...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_552
{ "fields": [ { "declarator": "Iterations = 1", "modifier": "final static", "original_string": "final static int Iterations = 1;", "type": "int", "var_name": "Iterations" }, { "declarator": "ReadIterations = 10000", "modifier": "final static", "original_stri...
{ "body": "@Test\n public void testRemove() {\n ConcurrentLongHashMap<String> map = new ConcurrentLongHashMap<>();\n\n assertTrue(map.isEmpty());\n assertNull(map.put(1, \"one\"));\n assertFalse(map.isEmpty());\n\n assertFalse(map.remove(0, \"zero\"));\n assertFalse(map.re...
{ "fields": [ { "declarator": "EmptyValue = null", "modifier": "private static final", "original_string": "private static final Object EmptyValue = null;", "type": "Object", "var_name": "EmptyValue" }, { "declarator": "DeletedValue = new Object()", "modifier": "pr...
{ "body": "public V remove(long key) {\n long h = hash(key);\n return getSection(h).remove(key, null, (int) h);\n }", "class_method_signature": "ConcurrentLongHashMap.remove(long key)", "constructor": false, "full_signature": "public V remove(long key)", "identifier": "remove", "invocations...
{ "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_417
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerSharedTest.java", "identifier": "LoadManagerSharedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemoveMostServicingBrokersForNamespace() throws Exception {\n String namespace = \"tenant1/ns1\";\n String assignedBundle = namespace + \"/0x00000000_0x40000000\";\n\n Set<String> candidates = Sets.newHashSet();\n ConcurrentOpenHashMap<String, Concurre...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(LoadManagerShared.class)", "modifier": "public static final", "original_string": "public static final Logger log = LoggerFactory.getLogger(LoadManagerShared.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "public static void removeMostServicingBrokersForNamespace(final String assignedBundleName,\n final Set<String> candidates,\n final ConcurrentOpenHashMap<String, ConcurrentOpenHashMap<String, ConcurrentOpenHashSet<String>>> brokerToNamespaceToBundleRange) {\n if (candidates.isEm...
{ "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_28
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/RoundRobinPartitionMessageRouterImplTest.java", "identifier": "RoundRobinPartitionMessageRouterImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBatchingAwareness() throws Exception {\n Message<?> msg = mock(Message.class);\n when(msg.getKey()).thenReturn(null);\n\n Clock clock = mock(Clock.class);\n\n RoundRobinPartitionMessageRouterImpl router = new RoundRobinPartitionMessageRouterImpl(\n ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "PARTITION_INDEX_UPDATER =\n At...
{ "body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata topicMetadata) {\n // If the message has a key, it supersedes the round robin routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), topicMetadata.numPartitions());\n }\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_460
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(NamespaceServiceTest.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(NamespaceServiceTest.class);", "type": "Logger", "var_name": "log" } ], ...
{ "body": "@Test\n public void testLoadReportDeserialize() throws Exception {\n\n final String candidateBroker1 = \"http://localhost:8000\";\n final String candidateBroker2 = \"http://localhost:3000\";\n LoadReport lr = new LoadReport(null, null, candidateBroker1, null);\n LocalBrokerDa...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(NamespaceService.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(NamespaceService.class);", "type": "Logger", "var_name": "LOG" }, { "...
{ "body": "protected CompletableFuture<LookupResult> createLookupResult(String candidateBroker, boolean authoritativeRedirect, final String advertisedListenerName)\n throws Exception {\n\n CompletableFuture<LookupResult> lookupFuture = new CompletableFuture<>();\n try {\n checkArgu...
{ "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_525
{ "fields": [ { "declarator": "classLoader", "modifier": "private final", "original_string": "private final ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" } ], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/ReflectionsTest.java...
{ "body": "@Test\n public void testCreateInstanceAbstractClass() {\n try {\n createInstance(AbstractClass.class.getName(), classLoader);\n fail(\"Should fail to load abstract class\");\n } catch (RuntimeException re) {\n assertTrue(re.getCause() instanceof Instantiati...
{ "fields": [ { "declarator": "constructorCache =\n new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<Class<?>, Constructor<?>> constructorCache =\n new ConcurrentHashMap<>();", "type": "Map<Class<?>, Constructor<?>>"...
{ "body": "public static <T> T createInstance(String userClassName,\n Class<T> xface,\n ClassLoader classLoader) {\n Class<?> theCls;\n try {\n theCls = Class.forName(userClassName, true, classLoader);\n } catc...
{ "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_175
{ "fields": [ { "declarator": "hash", "modifier": "private", "original_string": "private Hash hash;", "type": "Hash", "var_name": "hash" } ], "file": "pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/instance/FunctionResultRouterTest.java", "identifier": ...
{ "body": "@Test\n public void testChoosePartitionWithKeyWithoutSequenceId() {\n String key1 = \"key1\";\n String key2 = \"key2\";\n Message<?> msg1 = mock(Message.class);\n when(msg1.hasKey()).thenReturn(true);\n when(msg1.getKey()).thenReturn(key1);\n when(msg1.getSequen...
{ "fields": [ { "declarator": "INSTANCE = new FunctionResultRouter()", "modifier": "private static final", "original_string": "private static final FunctionResultRouter INSTANCE = new FunctionResultRouter();", "type": "FunctionResultRouter", "var_name": "INSTANCE" } ], "file"...
{ "body": "@Override\n public int choosePartition(Message msg, TopicMetadata metadata) {\n // if key is specified, we should use key as routing;\n // if key is not specified and no sequence id is provided, not an effectively-once publish, use the default\n // round-robin routing.\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_319
{ "fields": [], "file": "pulsar-io/hbase/src/test/java/org/apache/pulsar/io/hbase/sink/HbaseSinkConfigTest.java", "identifier": "HbaseSinkConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public final void loadFromMapTest() throws IOException {\n Map<String, Object> map = new HashMap<String, Object>();\n map.put(\"hbaseConfigResources\", \"hbase-site.xml\");\n map.put(\"zookeeperQuorum\", \"localhost\");\n map.put(\"zookeeperClientPort\", \"2181\");\n ...
{ "fields": [ { "declarator": "serialVersionUID = 1245636479605735555L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1245636479605735555L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "rowKe...
{ "body": "public static HbaseSinkConfig load(String yamlFile) throws IOException {\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n return mapper.readValue(new File(yamlFile), HbaseSinkConfig.class);\n }", "class_method_signature": "HbaseSinkConfig.load(String yamlFile)", "construc...
{ "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_437
{ "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 testNonExistentTopicSuperUserAccess() throws Exception {\n AuthorizationService authorizationService = spy(new AuthorizationService(svcConfig, configCacheService));\n doReturn(authorizationService).when(brokerService).getAuthorizationService();\n ...
{ "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 ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers() {\n return producers;\n }", "class_method_signature": "ServerCnx.getProducers()", "constructor": false, "full_signature": "public ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers()", "identifier": "get...
{ "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_122
{ "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 testGoodConfig() {\n TestConfig testConfig = createGoodConfig();\n ConfigValidation.validateConfig(testConfig);\n }", "class_method_signature": "ConfigValidationTest.testGoodConfig()", "constructor": false, "full_signature": "@Test public void testGoodConfig()"...
{ "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_572
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/AutoFailoverPolicyDataTest.java", "identifier": "AutoFailoverPolicyDataTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAutoFailoverPolicyData() {\n AutoFailoverPolicyData policy0 = new AutoFailoverPolicyData();\n AutoFailoverPolicyData policy1 = new AutoFailoverPolicyData();\n policy0.policy_type = AutoFailoverPolicyType.min_available;\n policy0.parameters = new HashMa...
{ "fields": [ { "declarator": "policy_type", "modifier": "@ApiModelProperty(\n name = \"policy_type\",\n value = \"The auto failover policy type\",\n allowableValues = \"min_available\"\n )\n @SuppressWarnings(\"checkstyle:MemberName\")\n public", "original_string":...
{ "body": "public void validate() {\n checkArgument(policy_type != null && parameters != null);\n AutoFailoverPolicyFactory.create(this);\n }", "class_method_signature": "AutoFailoverPolicyData.validate()", "constructor": false, "full_signature": "public void validate()", "identifier": "valid...
{ "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_421
{ "fields": [ { "declarator": "os = new OverloadShedder()", "modifier": "private final", "original_string": "private final OverloadShedder os = new OverloadShedder();", "type": "OverloadShedder", "var_name": "os" }, { "declarator": "conf", "modifier": "private fin...
{ "body": "@Test\n public void testBrokerWithSingleBundle() {\n LoadData loadData = new LoadData();\n\n LocalBrokerData broker1 = new LocalBrokerData();\n broker1.setBandwidthIn(new ResourceUsage(999, 1000));\n broker1.setBandwidthOut(new ResourceUsage(999, 1000));\n broker1.setB...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(OverloadShedder.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(OverloadShedder.class);", "type": "Logger", "var_name": "log" }, { "de...
{ "body": "@Override\n public Multimap<String, String> findBundlesForUnloading(final LoadData loadData, final ServiceConfiguration conf) {\n selectedBundlesCache.clear();\n final double overloadThreshold = conf.getLoadBalancerBrokerOverloadedThresholdPercentage() / 100.0;\n final Map<String, L...
{ "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_564
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/net/ServiceURITest.java", "identifier": "ServiceURITest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = NullPointerException.class)\n public void testNullServiceUriString() {\n ServiceURI.create((String) null);\n }", "class_method_signature": "ServiceURITest.testNullServiceUriString()", "constructor": false, "full_signature": "@Test(expectedExceptions = NullPoint...
{ "fields": [ { "declarator": "BINARY_SERVICE = \"pulsar\"", "modifier": "private static final", "original_string": "private static final String BINARY_SERVICE = \"pulsar\";", "type": "String", "var_name": "BINARY_SERVICE" }, { "declarator": "HTTP_SERVICE = \"http\"", ...
{ "body": "public static ServiceURI create(String uriStr) {\n checkNotNull(uriStr, \"service uri string is null\");\n\n if (uriStr.contains(\"[\") && uriStr.contains(\"]\")) {\n // deal with ipv6 address\n Splitter splitter = Splitter.on(CharMatcher.anyOf(\",;\"));\n Lis...
{ "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_134
{ "fields": [ { "declarator": "workerConfig", "modifier": "private final", "original_string": "private final WorkerConfig workerConfig;", "type": "WorkerConfig", "var_name": "workerConfig" }, { "declarator": "leaderService", "modifier": "private", "original_...
{ "body": "@Test\n public void testLeaderService() throws Exception {\n MessageId messageId = new MessageIdImpl(1, 2, -1);\n when(schedulerManager.getLastMessageProduced()).thenReturn(messageId);\n\n assertFalse(leaderService.isLeader());\n verify(mockClient, times(1)).newConsumer();\n\...
{ "fields": [ { "declarator": "consumerName", "modifier": "private final", "original_string": "private final String consumerName;", "type": "String", "var_name": "consumerName" }, { "declarator": "functionAssignmentTailer", "modifier": "private final", "orig...
{ "body": "public LeaderService(WorkerService workerService,\n PulsarClient pulsarClient,\n FunctionAssignmentTailer functionAssignmentTailer,\n SchedulerManager schedulerManager,\n FunctionRuntimeManager functionRuntimeMa...
{ "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_358
{ "fields": [], "file": "pulsar-storm/src/test/java/org/apache/pulsar/storm/PulsarSpoutTest.java", "identifier": "PulsarSpoutTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPulsarSpout() throws Exception {\n testPulsarSpout(false);\n }", "class_method_signature": "PulsarSpoutTest.testPulsarSpout()", "constructor": false, "full_signature": "@Test public void testPulsarSpout()", "identifier": "testPulsarSpout", "invocations": [ ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG = LoggerFactory.getLogger(PulsarSpout...
{ "body": "public PulsarSpout(PulsarSpoutConfiguration pulsarSpoutConf) {\n this(pulsarSpoutConf, PulsarClient.builder());\n }", "class_method_signature": "PulsarSpout.PulsarSpout(PulsarSpoutConfiguration pulsarSpoutConf)", "constructor": true, "full_signature": "public PulsarSpout(PulsarSpoutConfigu...
{ "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_476
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminResourceTest.java", "identifier": "AdminResourceTest", "interfaces": "", "superclass": "extends BrokerTestBase" }
{ "body": "@Test\n public void testValidatePartitionedTopicNameInvalid() {\n String tenant = \"test-tenant\";\n String namespace = \"test-namespace\";\n String topic = Codec.encode(\"test-topic-partition-0\");\n\n AdminResource resource = mockResource();\n try {\n reso...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AdminResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AdminResource.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "protected void validatePartitionedTopicName(String tenant, String namespace, String encodedTopic) {\n // first, it has to be a validate topic name\n validateTopicName(tenant, namespace, encodedTopic);\n // second, \"-partition-\" is not allowed\n if (encodedTopic.contains(TopicN...
{ "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_49
{ "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 = \".*Required.*\")\n public void testConfigureRequired() throws Exception {\n this.auth.configure(\"{}\");\n }", "class_method_signature": "AuthenticationOAuth2Test.testConfigureRequired()", "constr...
{ "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_163
{ "fields": [ { "declarator": "testWindowedPulsarFunction", "modifier": "private", "original_string": "private TestWindowFunctionExecutor testWindowedPulsarFunction;", "type": "TestWindowFunctionExecutor", "var_name": "testWindowedPulsarFunction" }, { "declarator": "con...
{ "body": "@Test\n public void testPrepareLateTupleStreamWithoutTs() throws Exception {\n context = Mockito.mock(Context.class);\n Mockito.doReturn(\"test-function\").when(context).getFunctionName();\n Mockito.doReturn(\"test-namespace\").when(context).getNamespace();\n Mockito.doReturn...
{ "fields": [ { "declarator": "initialized", "modifier": "private", "original_string": "private boolean initialized;", "type": "boolean", "var_name": "initialized" }, { "declarator": "windowConfig", "modifier": "protected", "original_string": "protected Wind...
{ "body": "@Override\n public O process(I input, Context context) throws Exception {\n if (!this.initialized) {\n initialize(context);\n }\n\n Record<I> record = (Record<I>)context.getCurrentRecord();\n\n if (isEventTime()) {\n long ts = this.timestampExtractor.ext...
{ "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_499
{ "fields": [], "file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/JsonSerializationSchemaTest.java", "identifier": "JsonSerializationSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = RuntimeException.class)\n public void testJsonSerializationSchemaWithNotSerializableObject() {\n NotSerializableObject notSerializableObject = new NotSerializableObject();\n JsonSerializationSchema schema = new JsonSerializationSchema();\n schema.serialize...
{ "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_533
{ "fields": [ { "declarator": "classLoader", "modifier": "private final", "original_string": "private final ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" } ], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/ReflectionsTest.java...
{ "body": "@Test\n public void testLoadClass() throws Exception {\n ClassLoader clsLoader = ClassLoader.getSystemClassLoader();\n Class[] classes = new Class[] {\n Integer.class,\n int.class,\n Byte.class,\n byte.class,\n Double.class,\n ...
{ "fields": [ { "declarator": "constructorCache =\n new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<Class<?>, Constructor<?>> constructorCache =\n new ConcurrentHashMap<>();", "type": "Map<Class<?>, Constructor<?>>"...
{ "body": "public static Class loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {\n if (className.length() == 1) {\n char type = className.charAt(0);\n if (type == 'B') {\n return Byte.TYPE;\n } else if (type == 'C') {\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_118
{ "fields": [ { "declarator": "LOG_MESSAGE = \"Hello, world!\"", "modifier": "private static final", "original_string": "private static final String LOG_MESSAGE = \"Hello, world!\";", "type": "String", "var_name": "LOG_MESSAGE" }, { "declarator": "clientBuilder", ...
{ "body": "@Test\n public void testAppendWithSerializedLayout() throws Exception {\n final Appender appender = ctx.getConfiguration().getAppender(\"PulsarAppenderWithSerializedLayout\");\n final LogEvent logEvent = createLogEvent();\n appender.append(logEvent);\n final Message<byte[]> i...
{ "fields": [ { "declarator": "avoidRecursive", "modifier": "private final", "original_string": "private final boolean avoidRecursive;", "type": "boolean", "var_name": "avoidRecursive" }, { "declarator": "manager", "modifier": "private final", "original_stri...
{ "body": "@Override\n public void append(final LogEvent event) {\n if (avoidRecursive\n && event.getLoggerName() != null\n && event.getLoggerName().startsWith(\"org.apache.pulsar\")) {\n LOGGER.warn(\"Recursive logging from [{}] for appender [{}].\", event.getLoggerName(), ...
{ "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_548
{ "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 testLastRange() {\n ConcurrentOpenLongPairRangeSet<LongPair> set = new ConcurrentOpenLongPairRangeSet<>(consumer);\n assertNull(set.lastRange());\n Range<LongPair> range = Range.openClosed(new LongPair(0, 97), new LongPair(0, 99));\n set.add(range);\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> lastRange() {\n if (rangeBitSetMap.isEmpty()) {\n return null;\n }\n Entry<Long, BitSet> lastSet = rangeBitSetMap.lastEntry();\n int upper = lastSet.getValue().previousSetBit(lastSet.getValue().size());\n int lower = Math.min(last...
{ "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_32
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageAckerDisabledTest.java", "identifier": "BatchMessageAckerDisabledTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOutstandingAcks() {\n assertEquals(0, BatchMessageAckerDisabled.INSTANCE.getOutstandingAcks());\n }", "class_method_signature": "BatchMessageAckerDisabledTest.testGetOutstandingAcks()", "constructor": false, "full_signature": "@Test public void testGetOutstandi...
{ "fields": [ { "declarator": "INSTANCE = new BatchMessageAckerDisabled()", "modifier": "static final", "original_string": "static final BatchMessageAckerDisabled INSTANCE = new BatchMessageAckerDisabled();", "type": "BatchMessageAckerDisabled", "var_name": "INSTANCE" } ], "f...
{ "body": "@Override\n public int getOutstandingAcks() {\n return 0;\n }", "class_method_signature": "BatchMessageAckerDisabled.getOutstandingAcks()", "constructor": false, "full_signature": "@Override public int getOutstandingAcks()", "identifier": "getOutstandingAcks", "invocations": [], "m...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_374
{ "fields": [], "file": "pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnectorConfig.java", "identifier": "TestPulsarConnectorConfig", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOffloadPolices() throws Exception {\n PulsarConnectorConfig connectorConfig = new PulsarConnectorConfig();\n\n final String managedLedgerOffloadDriver = \"s3\";\n final String offloaderDirectory = \"/pulsar/offloaders\";\n final int managedLedgerOff...
{ "fields": [ { "declarator": "brokerServiceUrl = \"http://localhost:8080\"", "modifier": "private", "original_string": "private String brokerServiceUrl = \"http://localhost:8080\";", "type": "String", "var_name": "brokerServiceUrl" }, { "declarator": "zookeeperUri = \"...
{ "body": "public OffloadPolicies getOffloadPolices() {\n Properties offloadProperties = new Properties();\n offloadProperties.putAll(getOffloaderProperties());\n OffloadPolicies offloadPolicies = OffloadPolicies.create(offloadProperties);\n offloadPolicies.setManagedLedgerOffloadDriver(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_231
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeEqual() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createFunctionConfig();\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionConfig, newFunctionConfig);\n assertEquals(...
{ "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_65
{ "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 testConsumerBuilderImplWhenPatternAutoDiscoveryPeriodPeriodInMinutesIsNegative() {\n consumerBuilderImpl.patternAutoDiscoveryPeriod(-1);\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWh...
{ "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> patternAutoDiscoveryPeriod(int periodInMinutes) {\n checkArgument(periodInMinutes >= 0, \"periodInMinutes needs to be >= 0\");\n patternAutoDiscoveryPeriod(periodInMinutes, TimeUnit.MINUTES);\n return this;\n }", "class_method_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_323
{ "fields": [], "file": "pulsar-io/mongo/src/test/java/org/apache/pulsar/io/mongodb/MongoConfigTest.java", "identifier": "MongoConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMap() throws IOException {\n final Map<String, Object> map = TestHelper.createMap(true);\n final MongoConfig cfg = MongoConfig.load(map);\n\n assertEquals(cfg.getMongoUri(), TestHelper.URI);\n assertEquals(cfg.getDatabase(), TestHelper.DB);\n as...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "DEFAULT_BATCH_SIZE = 100", "modifie...
{ "body": "public static MongoConfig load(String yamlFile) throws IOException {\n final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n final MongoConfig cfg = mapper.readValue(new File(yamlFile), MongoConfig.class);\n\n return cfg;\n }", "class_method_signature": "MongoConfig.l...
{ "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_289
{ "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 testZKCreationRO() throws Exception {\n ZooKeeperClientFactory zkf = new ZookeeperBkClientFactoryImpl(executor);\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"127.0.0.1:\" + localZkS.getZookeeperPort(),\n SessionType.AllowReadOnly, (int) ZOOKEEPE...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ZookeeperBkClientFactoryImpl.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ZookeeperBkClientFactoryImpl.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public CompletableFuture<ZooKeeper> create(String serverList, SessionType sessionType, int zkSessionTimeoutMillis) {\n CompletableFuture<ZooKeeper> future = new CompletableFuture<>();\n\n executor.execute(safeRun(() -> {\n try {\n ZooKeeper zk = ZooKee...
{ "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_266
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java", "identifier": "WindowConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSettingTumblingTimeWindow() 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\n Long windowLengthDuration = null;\n ...
{ "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_159
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/auth/KubernetesSecretsTokenAuthProviderTest.java", "identifier": "KubernetesSecretsTokenAuthProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUpdateAuthData() throws Exception {\n CoreV1Api coreV1Api = mock(CoreV1Api.class);\n KubernetesSecretsTokenAuthProvider kubernetesSecretsTokenAuthProvider = new KubernetesSecretsTokenAuthProvider();\n kubernetesSecretsTokenAuthProvider.initialize(coreV1Api, n...
{ "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> updateAuthData(Function.FunctionDetails funcDetails,\n Optional<FunctionAuthData> existingFunctionAuthData,\n AuthenticationDataSource authenticationDataS...
{ "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_509
{ "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 testTopicsWithBlank() {\n pulsarSourceBuilder.topics(Arrays.asList(\" \", \" \"));\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicsWithBlank()", "constructor": false, "full_signature": "@Test(expe...
{ "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> topics(List<String> topics) {\n Preconditions.checkArgument(topics != null && !topics.isEmpty(), \"topics cannot be blank\");\n topics.forEach(topicName ->\n Preconditions.checkArgument(StringUtils.isNotBlank(topicName), \"topicNames cannot have bl...
{ "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_73
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java", "identifier": "AvroSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllowNullSchema() throws JSONException {\n AvroSchema<Foo> avroSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n assertEquals(avroSchema.getSchemaInfo().getType(), SchemaType.AVRO);\n Schema.Parser parser = new Schema.Pars...
{ "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_335
{ "fields": [], "file": "pulsar-io/common/src/test/java/org/apache/pulsar/io/common/IOConfigUtilsTest.java", "identifier": "IOConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSourceLoadWithSecrets() {\n Map<String, Object> configMap = new HashMap<>();\n configMap.put(\"notSensitive\", \"foo\");\n TestConfig testConfig = IOConfigUtils.loadWithSecrets(configMap, TestConfig.class, new TestSourceContext());\n\n Assert.assertEqu...
{ "fields": [], "file": "pulsar-io/common/src/main/java/org/apache/pulsar/io/common/IOConfigUtils.java", "identifier": "IOConfigUtils", "interfaces": "", "methods": [ { "class_method_signature": "IOConfigUtils.loadWithSecrets(Map<String, Object> map, Class<T> clazz, SourceContext sourceContext)", ...
{ "body": "public static <T> T loadWithSecrets(Map<String, Object> map, Class<T> clazz, SourceContext sourceContext) {\n return loadWithSecrets(map, clazz, secretName -> sourceContext.getSecret(secretName));\n }", "class_method_signature": "IOConfigUtils.loadWithSecrets(Map<String, Object> map, Class<T> c...
{ "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_270
{ "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 = \"Sink Names differ\")\n public void testMergeDifferentName() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"name\", \"Different\");\n ...
{ "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_24
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/RoundRobinPartitionMessageRouterImplTest.java", "identifier": "RoundRobinPartitionMessageRouterImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChoosePartitionWithoutKey() {\n Message<?> msg = mock(Message.class);\n when(msg.getKey()).thenReturn(null);\n\n RoundRobinPartitionMessageRouterImpl router = new RoundRobinPartitionMessageRouterImpl(\n HashingScheme.JavaStringHash, 0, false, 0...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "PARTITION_INDEX_UPDATER =\n At...
{ "body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata topicMetadata) {\n // If the message has a key, it supersedes the round robin routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), topicMetadata.numPartitions());\n }\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_362
{ "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 testGetTableMetadataWrongSchema(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n PulsarTableHandle pulsarTableHandle = new PulsarTableHandle(\n pulsarConnector...
{ "fields": [ { "declarator": "connectorId", "modifier": "private final", "original_string": "private final String connectorId;", "type": "String", "var_name": "connectorId" }, { "declarator": "pulsarAdmin", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) {\n ConnectorTableMetadata connectorTableMetadata;\n SchemaTableName schemaTableName = convertTableHandle(table).toSchemaTableName();\n connectorTableMetadata = getTableM...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_227
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionCommonTest.java", "identifier": "FunctionCommonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testValidateHttpFileUrl() throws Exception {\n\n String jarHttpUrl = \"https://repo1.maven.org/maven2/org/apache/pulsar/pulsar-common/2.4.2/pulsar-common-2.4.2.jar\";\n FunctionCommon.extractClassLoader(jarHttpUrl);\n\n jarHttpUrl = \"http://_invalidurl_.com\";\n...
{ "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 ClassLoader extractClassLoader(String destPkgUrl) throws IOException, URISyntaxException {\n File file = extractFileFromPkgURL(destPkgUrl);\n try {\n return ClassLoaderUtils.loadJar(file);\n } catch (MalformedURLException e) {\n throw new IllegalArgu...
{ "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_363
{ "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 testGetTableMetadataWrongTable(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n PulsarTableHandle pulsarTableHandle = new PulsarTableHandle(\n pulsarConnectorI...
{ "fields": [ { "declarator": "connectorId", "modifier": "private final", "original_string": "private final String connectorId;", "type": "String", "var_name": "connectorId" }, { "declarator": "pulsarAdmin", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) {\n ConnectorTableMetadata connectorTableMetadata;\n SchemaTableName schemaTableName = convertTableHandle(table).toSchemaTableName();\n connectorTableMetadata = getTableM...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_226
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionCommonTest.java", "identifier": "FunctionCommonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testValidateLocalFileUrl() throws Exception {\n String fileLocation = FutureUtil.class.getProtectionDomain().getCodeSource().getLocation().getPath();\n try {\n // eg: fileLocation : /dir/fileName.jar (invalid)\n FunctionCommon.extractClassLoader(fi...
{ "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 ClassLoader extractClassLoader(String destPkgUrl) throws IOException, URISyntaxException {\n File file = extractFileFromPkgURL(destPkgUrl);\n try {\n return ClassLoaderUtils.loadJar(file);\n } catch (MalformedURLException e) {\n throw new IllegalArgu...
{ "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_25
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/RoundRobinPartitionMessageRouterImplTest.java", "identifier": "RoundRobinPartitionMessageRouterImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChoosePartitionWithoutKeyWithBatching() {\n Message<?> msg = mock(Message.class);\n when(msg.getKey()).thenReturn(null);\n\n // Fake clock, simulate 1 millisecond passes for each invocation\n Clock clock = new Clock() {\n private long curren...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "PARTITION_INDEX_UPDATER =\n At...
{ "body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata topicMetadata) {\n // If the message has a key, it supersedes the round robin routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), topicMetadata.numPartitions());\n }\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_334
{ "fields": [], "file": "pulsar-io/redis/src/test/java/org/apache/pulsar/io/redis/sink/RedisSinkConfigTest.java", "identifier": "RedisSinkConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public final void loadFromMapTest() throws IOException {\n Map<String, Object> map = new HashMap<String, Object>();\n map.put(\"redisHosts\", \"localhost:6379\");\n map.put(\"redisPassword\", \"fake@123\");\n map.put(\"redisDatabase\", \"1\");\n map.put(\"clien...
{ "fields": [ { "declarator": "serialVersionUID = 4686456460365805717L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 4686456460365805717L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "opera...
{ "body": "public static RedisSinkConfig load(String yamlFile) throws IOException {\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n return mapper.readValue(new File(yamlFile), RedisSinkConfig.class);\n }", "class_method_signature": "RedisSinkConfig.load(String yamlFile)", "construc...
{ "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_271
{ "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 = \"Tenants differ\")\n public void testMergeDifferentTenant() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"tenant\", \"Different\");\n ...
{ "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_158
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/auth/KubernetesSecretsTokenAuthProviderTest.java", "identifier": "KubernetesSecretsTokenAuthProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void configureAuthenticationConfig() {\n byte[] testBytes = new byte[]{0, 1, 2, 3, 4};\n CoreV1Api coreV1Api = mock(CoreV1Api.class);\n KubernetesSecretsTokenAuthProvider kubernetesSecretsTokenAuthProvider = new KubernetesSecretsTokenAuthProvider();\n kubernete...
{ "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 void configureAuthenticationConfig(AuthenticationConfig authConfig, Optional<FunctionAuthData> functionAuthData) {\n if (!functionAuthData.isPresent()) {\n // if auth data is not present maybe user is trying to use anonymous role thus don't pass in any auth config\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_508
{ "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 testTopicsWithNull() {\n pulsarSourceBuilder.topics(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicsWithNull()", "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> topics(List<String> topics) {\n Preconditions.checkArgument(topics != null && !topics.isEmpty(), \"topics cannot be blank\");\n topics.forEach(topicName ->\n Preconditions.checkArgument(StringUtils.isNotBlank(topicName), \"topicNames cannot have bl...
{ "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" ...