id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
62117812_72
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java", "identifier": "AvroSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAllowNullSchema() throws JSONException {\n AvroSchema<Foo> avroSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).withAlwaysAllowNull(false).build());\n assertEquals(avroSchema.getSchemaInfo().getType(), SchemaType.AVRO);\n Schema.P...
{ "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_322
{ "fields": [ { "declarator": "mockRecord", "modifier": "@Mock\n private", "original_string": "@Mock\n private Record<byte[]> mockRecord;", "type": "Record<byte[]>", "var_name": "mockRecord" }, { "declarator": "mockSinkContext", "modifier": "@Mock\n priva...
{ "body": "@Test\n public void testOpen() throws Exception {\n sink.open(map, mockSinkContext);\n }", "class_method_signature": "MongoSinkTest.testOpen()", "constructor": false, "full_signature": "@Test public void testOpen()", "identifier": "testOpen", "invocations": [ "open" ], "modif...
{ "fields": [ { "declarator": "mongoConfig", "modifier": "private", "original_string": "private MongoConfig mongoConfig;", "type": "MongoConfig", "var_name": "mongoConfig" }, { "declarator": "mongoClient", "modifier": "private", "original_string": "private M...
{ "body": "@Override\n public void open(Map<String, Object> config, SinkContext sinkContext) throws Exception {\n log.info(\"Open MongoDB Sink\");\n\n mongoConfig = MongoConfig.load(config);\n mongoConfig.validate(true, true);\n\n if (clientProvider != null) {\n mongoClient =...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_288
{ "fields": [ { "declarator": "localZkS", "modifier": "private", "original_string": "private ZookeeperServerTest localZkS;", "type": "ZookeeperServerTest", "var_name": "localZkS" }, { "declarator": "localZkc", "modifier": "private", "original_string": "priva...
{ "body": "@Test\n public void testZKCreationRW() throws Exception {\n ZooKeeperClientFactory zkf = new ZookeeperBkClientFactoryImpl(executor);\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"127.0.0.1:\" + localZkS.getZookeeperPort(), SessionType.ReadWrite,\n (int) ZOOKEEPER_SE...
{ "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_267
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java", "identifier": "WindowConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSettingLagTime() 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 maxLagMs = null;\n if (arg0 != 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_64
{ "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 testConsumerBuilderImplWhenMaxTotalReceiverQueueSizeAcrossPartitionsPropertyIsNegative() {\n consumerBuilderImpl.maxTotalReceiverQueueSizeAcrossPartitions(-1);\n }", "class_method_signature": "ConsumerBuilderImplTest.te...
{ "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> maxTotalReceiverQueueSizeAcrossPartitions(int maxTotalReceiverQueueSizeAcrossPartitions) {\n checkArgument(maxTotalReceiverQueueSizeAcrossPartitions >= 0, \"maxTotalReceiverQueueSizeAcrossPartitions needs to be >= 0\");\n conf.setMaxTotalReceiverQueueS...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_375
{ "fields": [ { "declarator": "config", "modifier": "", "original_string": "ServiceConfiguration config;", "type": "ServiceConfiguration", "var_name": "config" }, { "declarator": "properties", "modifier": "", "original_string": "Properties properties;", ...
{ "body": "@Test\n public void testAuthenticateSignedToken() throws Exception {\n\n List<String> roles = new ArrayList<String>() {\n {\n add(\"test_role\");\n }\n };\n RoleToken token = new RoleToken.Builder(\"Z1\", \"test_provider\", roles).principal(\"tes...
{ "fields": [ { "declarator": "DOMAIN_NAME_LIST = \"athenzDomainNames\"", "modifier": "private static final", "original_string": "private static final String DOMAIN_NAME_LIST = \"athenzDomainNames\";", "type": "String", "var_name": "DOMAIN_NAME_LIST" }, { "declarator": ...
{ "body": "@Override\n public String authenticate(AuthenticationDataSource authData) throws AuthenticationException {\n SocketAddress clientAddress;\n String roleToken;\n\n if (authData.hasDataFromPeer()) {\n clientAddress = authData.getPeerAddress();\n } else {\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_230
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionCommonTest.java", "identifier": "FunctionCommonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMessageId() {\n long lid = 12345L;\n long eid = 34566L;\n long sequenceId = (lid << 28) | eid;\n\n MessageIdImpl id = (MessageIdImpl) FunctionCommon.getMessageId(sequenceId);\n assertEquals(lid, id.getLedgerId());\n assertEquals(eid, i...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionCommon.java", "identifier": "FunctionCommon", "interfaces": "", "methods": [ { "class_method_signature": "FunctionCommon.printJson(MessageOrBuilder msg)", "constructor": false, "full_s...
{ "body": "public static final MessageId getMessageId(long sequenceId) {\n // Demultiplex ledgerId and entryId from offset\n long ledgerId = sequenceId >>> 28;\n long entryId = sequenceId & 0x0F_FF_FF_FFL;\n\n return new MessageIdImpl(ledgerId, entryId, -1);\n }", "class_method_signat...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_119
{ "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 testAsyncAppend() {\n final Appender appender = ctx.getConfiguration().getAppender(\"AsyncPulsarAppender\");\n appender.append(createLogEvent());\n final Message<byte[]> item;\n synchronized (history) {\n assertEquals(1, history.size());\n ...
{ "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_549
{ "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 testToString() {\n ConcurrentOpenLongPairRangeSet<LongPair> set = new ConcurrentOpenLongPairRangeSet<>(consumer);\n Range<LongPair> range = Range.openClosed(new LongPair(0, 97), new LongPair(0, 99));\n set.add(range);\n assertEquals(set.toString(), \"[(0:9...
{ "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 String toString() {\n if (updatedAfterCachedForToString) {\n StringBuilder toString = new StringBuilder();\n AtomicBoolean first = new AtomicBoolean(true);\n if (toString != null) {\n toString.append(\"[\");\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_33
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtilsTest.java", "identifier": "ConfigurationDataUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadClientConfigurationData() {\n ClientConfigurationData confData = new ClientConfigurationData();\n confData.setServiceUrl(\"pulsar://unknown:6650\");\n confData.setMaxLookupRequest(600);\n confData.setMaxLookupRedirects(10);\n confData.setNum...
{ "fields": [ { "declarator": "mapper = new FastThreadLocal<ObjectMapper>() {\n @Override\n protected ObjectMapper initialValue() throws Exception {\n return create();\n }\n }", "modifier": "private static final", "original_string": "private static final FastTh...
{ "body": "public static <T> T loadData(Map<String, Object> config,\n T existingData,\n Class<T> dataCls) {\n ObjectMapper mapper = getThreadLocal();\n try {\n String existingConfigJson = mapper.writeValueAsString(existingData);\...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_477
{ "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 testValidatePartitionedTopicMetadata() throws Exception {\n String tenant = \"prop\";\n String namespace = \"ns-abc\";\n String partitionedTopic = \"partitionedTopic\";\n String nonPartitionedTopic = \"notPartitionedTopic\";\n int partitions = 3;\n\...
{ "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 validatePartitionedTopicMetadata(String tenant, String namespace, String encodedTopic) {\n try {\n PartitionedTopicMetadata partitionedTopicMetadata =\n pulsar().getBrokerService().fetchPartitionedTopicMetadataAsync(topicName).get();\n if (part...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_48
{ "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 = \".*Malformed.*\")\n public void testConfigureMalformed() throws Exception {\n this.auth.configure(\"{garbage}\");\n }", "class_method_signature": "AuthenticationOAuth2Test.testConfigureMalformed()",...
{ "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_162
{ "fields": [ { "declarator": "testWindowedPulsarFunction", "modifier": "private", "original_string": "private TestWindowFunctionExecutor testWindowedPulsarFunction;", "type": "TestWindowFunctionExecutor", "var_name": "testWindowedPulsarFunction" }, { "declarator": "con...
{ "body": "@Test\n public void testExecuteWithTs() throws Exception {\n long[] timestamps = {603, 605, 607, 618, 626, 636};\n for (long ts : timestamps) {\n Record<?> record = Mockito.mock(Record.class);\n Mockito.doReturn(Optional.of(\"test-topic\")).when(record).getTopicName()...
{ "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_498
{ "fields": [], "file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/JsonSerializationSchemaTest.java", "identifier": "JsonSerializationSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testJsonSerializationSchemaWithEmptyRecord() throws IOException {\n Employee employee = new Employee();\n JsonSerializationSchema schema = new JsonSerializationSchema();\n byte[] employeeBytes = schema.serialize(employee);\n String jsonContent = IOUtils.to...
{ "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_532
{ "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 testClassExists() {\n assertTrue(Reflections.classExists(String.class.getName()));\n assertFalse(Reflections.classExists(\"com.fake.class\"));\n }", "class_method_signature": "ReflectionsTest.testClassExists()", "constructor": false, "full_signature": "@Test pu...
{ "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 boolean classExists(String fqcn) {\n try {\n Class.forName(fqcn);\n return true;\n } catch (ClassNotFoundException e) {\n return false;\n }\n }", "class_method_signature": "Reflections.classExists(String fqcn)", "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_359
{ "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 testListSchemaNames(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n List<String> schemas = this.pulsarMetadata.listSchemaNames(mock(ConnectorSession.class));\n\n\n if...
{ "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 List<String> listSchemaNames(ConnectorSession session) {\n List<String> prestoSchemas = new LinkedList<>();\n try {\n List<String> tenants = pulsarAdmin.tenants().getTenants();\n for (String tenant : tenants) {\n prestoSchemas.addAll(...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_420
{ "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 testBrokerNotOverloaded() {\n LoadData loadData = new LoadData();\n\n LocalBrokerData broker1 = new LocalBrokerData();\n broker1.setBandwidthIn(new ResourceUsage(500, 1000));\n broker1.setBandwidthOut(new ResourceUsage(500, 1000));\n broker1.setBund...
{ "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_565
{ "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 testNullServiceUriInstance() {\n ServiceURI.create((URI) null);\n }", "class_method_signature": "ServiceURITest.testNullServiceUriInstance()", "constructor": false, "full_signature": "@Test(expectedExceptions = NullPoin...
{ "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_135
{ "fields": [ { "declarator": "TEST_NAME = \"test-fmt\"", "modifier": "private static final", "original_string": "private static final String TEST_NAME = \"test-fmt\";", "type": "String", "var_name": "TEST_NAME" }, { "declarator": "reader", "modifier": "private fi...
{ "body": "@Test\n public void testUpdate() throws Exception {\n\n FunctionMetaData request = FunctionMetaData.newBuilder().build();\n\n Message msg = mock(Message.class);\n when(msg.getData()).thenReturn(request.toByteArray());\n CountDownLatch readLatch = new CountDownLatch(1);\n ...
{ "fields": [ { "declarator": "functionMetaDataManager", "modifier": "private final", "original_string": "private final FunctionMetaDataManager functionMetaDataManager;", "type": "FunctionMetaDataManager", "var_name": "functionMetaDataManager" }, { "declarator": "reader...
{ "body": "public void start() {\n isRunning = true;\n tailerThread.start();\n }", "class_method_signature": "FunctionMetaDataTopicTailer.start()", "constructor": false, "full_signature": "public void start()", "identifier": "start", "invocations": [ "start" ], "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_436
{ "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 testProducerCommandWithAuthorizationPositive() throws Exception {\n AuthorizationService authorizationService = mock(AuthorizationService.class);\n doReturn(CompletableFuture.completedFuture(true)).when(authorizationService).allowTopicOperationAsync(Moc...
{ "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_123
{ "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 testNotNull() {\n TestConfig testConfig = createGoodConfig();\n testConfig.stringValue = null;\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage().contains(\"stringVal...
{ "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_573
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/NamespaceIsolationDataTest.java", "identifier": "NamespaceIsolationDataTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNamespaceIsolationData() {\n NamespaceIsolationData n0 = new NamespaceIsolationData();\n NamespaceIsolationData n1 = new NamespaceIsolationData();\n assertNotEquals(new OldPolicies(), n0);\n n0.namespaces = new ArrayList<>();\n n0.primary = new ...
{ "fields": [ { "declarator": "namespaces = new ArrayList<String>()", "modifier": "@ApiModelProperty(\n name = \"namespaces\",\n value = \"The list of namespaces to apply this namespace isolation data\"\n )\n public", "original_string": "@ApiModelProperty(\n name = \"n...
{ "body": "public void validate() {\n checkArgument(namespaces != null && !namespaces.isEmpty() && primary != null && !primary.isEmpty()\n && secondary != null && auto_failover_policy != null);\n auto_failover_policy.validate();\n }", "class_method_signature": "NamespaceIsolationData...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_318
{ "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 loadFromYamlFileTest() throws IOException {\n File yamlFile = getFile(\"sinkConfig.yaml\");\n String path = yamlFile.getAbsolutePath();\n HbaseSinkConfig config = HbaseSinkConfig.load(path);\n assertNotNull(config);\n assertEquals(\"hbase-site...
{ "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_461
{ "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 testCreateLookupResult() throws Exception {\n\n final String candidateBroker = \"pulsar://localhost:6650\";\n final String listenerUrl = \"pulsar://localhost:7000\";\n final String listenerUrlTls = \"pulsar://localhost:8000\";\n final String listener = \"l...
{ "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_524
{ "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 testCreateInstanceConstructorThrowsException() {\n try {\n createInstance(ThrowExceptionClass.class.getName(), classLoader);\n fail(\"Should fail to load class whose constructor throws exceptions\");\n } catch (RuntimeException re) {\n a...
{ "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_174
{ "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 testChoosePartitionWithoutKeySequenceId() {\n TopicMetadata topicMetadata = mock(TopicMetadata.class);\n when(topicMetadata.numPartitions()).thenReturn(5);\n\n Clock clock = mock(Clock.class);\n\n FunctionResultRouter router = new FunctionResultRouter(0, c...
{ "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_103
{ "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 testSchema() {\n ProtobufSchema<org.apache.pulsar.client.schema.proto.Test.TestMessage> protobufSchema\n = ProtobufSchema.of(org.apache.pulsar.client.schema.proto.Test.TestMessage.class);\n\n Assert.assertEquals(protobufSchema.getSchemaInfo().getType(), S...
{ "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_553
{ "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 testPutIfAbsent() {\n ConcurrentLongHashMap<String> map = new ConcurrentLongHashMap<>();\n assertNull(map.putIfAbsent(1, \"one\"));\n assertEquals(map.get(1), \"one\");\n\n assertEquals(map.putIfAbsent(1, \"uno\"), \"one\");\n assertEquals(map.get(1...
{ "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 putIfAbsent(long key, V value) {\n checkNotNull(value);\n long h = hash(key);\n return getSection(h).put(key, value, (int) h, true, null);\n }", "class_method_signature": "ConcurrentLongHashMap.putIfAbsent(long key, V value)", "constructor": false, "full_signature": "...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_416
{ "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(expectedExceptions = RuntimeException.class)\n public void testNewChannelInitializersOverlapped() {\n ChannelInitializer<SocketChannel> i1 = mock(ChannelInitializer.class);\n ChannelInitializer<SocketChannel> i2 = mock(ChannelInitializer.class);\n Map<InetSocketAddress, Channe...
{ "fields": [ { "declarator": "handlers", "modifier": "private final", "original_string": "private final Map<String, ProtocolHandlerWithClassLoader> handlers;", "type": "Map<String, ProtocolHandlerWithClassLoader>", "var_name": "handlers" } ], "file": "pulsar-broker/src/main/...
{ "body": "public Map<String, Map<InetSocketAddress, ChannelInitializer<SocketChannel>>> newChannelInitializers() {\n Map<String, Map<InetSocketAddress, ChannelInitializer<SocketChannel>>> channelInitializers = Maps.newHashMap();\n Set<InetSocketAddress> addresses = Sets.newHashSet();\n\n for (Ma...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_29
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/TopicMetadataImplTest.java", "identifier": "TopicMetadataImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNumPartitions() {\n TopicMetadataImpl metadata = new TopicMetadataImpl(1234);\n assertEquals(1234, metadata.numPartitions());\n }", "class_method_signature": "TopicMetadataImplTest.testNumPartitions()", "constructor": false, "full_signature": "@Test public ...
{ "fields": [ { "declarator": "numPartitions", "modifier": "private final", "original_string": "private final int numPartitions;", "type": "int", "var_name": "numPartitions" } ], "file": "pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMetadataImpl.java", "id...
{ "body": "@Override\n public int numPartitions() {\n return numPartitions;\n }", "class_method_signature": "TopicMetadataImpl.numPartitions()", "constructor": false, "full_signature": "@Override public int numPartitions()", "identifier": "numPartitions", "invocations": [], "modifiers": "@Ove...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_380
{ "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 testAuthenticateWhenAuthorizationHeaderNotExist() throws AuthenticationException {\n AuthenticationProviderToken provider = new AuthenticationProviderToken();\n provider.authenticate(new AuthenticationDataSource() {\n ...
{ "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_504
{ "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 testServiceUrlWithNull() {\n pulsarSourceBuilder.serviceUrl(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testServiceUrlWithNull()", "constructor": false, "full_signature": "@Test(expectedException...
{ "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_154
{ "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 testNoOpKubernetesManifestCustomizer() throws Exception {\n InstanceConfig config = createJavaInstanceConfig(FunctionDetails.Runtime.JAVA, false);\n config.setFunctionDetails(createFunctionDetails(FunctionDetails.Runtime.JAVA, false, (fb) -> {\n JsonObject co...
{ "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 V1Service createService() {\n final String jobName = createJobName(instanceConfig.getFunctionDetails());\n\n final V1Service service = new V1Service();\n\n // setup stateful set metadata\n final V1ObjectMeta objectMeta = new V1ObjectMeta();\n objec...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_91
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/BytesSchemaTest.java", "identifier": "BytesSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBytesSchemaOf() {\n testBytesSchema(BytesSchema.of());\n }", "class_method_signature": "BytesSchemaTest.testBytesSchemaOf()", "constructor": false, "full_signature": "@Test public void testBytesSchemaOf()", "identifier": "testBytesSchemaOf", "invocations": [ ...
{ "fields": [ { "declarator": "INSTANCE", "modifier": "private static final", "original_string": "private static final BytesSchema INSTANCE;", "type": "BytesSchema", "var_name": "INSTANCE" }, { "declarator": "SCHEMA_INFO", "modifier": "private static final", ...
{ "body": "public static BytesSchema of() {\n return INSTANCE;\n }", "class_method_signature": "BytesSchema.of()", "constructor": false, "full_signature": "public static BytesSchema of()", "identifier": "of", "invocations": [], "modifiers": "public static", "parameters": "()", "return": "Byt...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_441
{ "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, invocationCount = 1, skipFailedInvocations = true)\n public void testCreateProducerBookieTimeout() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Delay the topic creation in a deterministic way\n CompletableFuture<Runnable> openFai...
{ "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_338
{ "fields": [], "file": "pulsar-io/solr/src/test/java/org/apache/pulsar/io/solr/SolrSinkConfigTest.java", "identifier": "SolrSinkConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public final void loadFromMapTest() throws IOException {\n Map<String, Object> map = new HashMap<>();\n map.put(\"solrUrl\", \"localhost:2181,localhost:2182/chroot\");\n map.put(\"solrMode\", \"SolrCloud\");\n map.put(\"solrCollection\", \"techproducts\");\n ma...
{ "fields": [ { "declarator": "serialVersionUID = -4849066206354610110L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -4849066206354610110L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "sol...
{ "body": "public static SolrSinkConfig load(String yamlFile) throws IOException {\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n return mapper.readValue(new File(yamlFile), SolrSinkConfig.class);\n }", "class_method_signature": "SolrSinkConfig.load(String yamlFile)", "constructor...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_292
{ "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 ZookeeperClientFactoryImpl();\n CompletableFuture<ZooKeeper> zkFuture = zkf.create(\"127.0.0.1:\" + localZkS.getZookeeperPort(),\n SessionType.AllowReadOnly, (int) ZOOKEEPER_SESSION_...
{ "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_87
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java", "identifier": "JSONSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = SchemaSerializationException.class)\n public void testAllowNullDecodeWithInvalidContent() {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n jsonSchema.decode(new byte[0]);\n }", "class_method_signa...
{ "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_142
{ "fields": [], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/FunctionActionerTest.java", "identifier": "FunctionActionerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStartFunctionWithDLNamespace() throws Exception {\n\n WorkerConfig workerConfig = new WorkerConfig();\n workerConfig.setWorkerId(\"worker-1\");\n workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());\n workerConfig.setF...
{ "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_512
{ "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 testTopicPattenStringWithNull() {\n pulsarSourceBuilder.topicsPatternString(null);\n }", "class_method_signature": "PulsarSourceBuilderTest.testTopicPattenStringWithNull()", "constructor": false, "full_signature": "...
{ "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> topicsPatternString(String topicsPattern) {\n Preconditions.checkArgument(StringUtils.isNotBlank(topicsPattern), \"Topics pattern string cannot be blank\");\n Preconditions.checkArgument(this.consumerConfigurationData.getTopicsPattern() == null,\n \"Pa...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_457
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(OwnershipCacheTest.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(OwnershipCacheTest.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Test\n public void testConstructor() {\n OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory, nsService);\n assertNotNull(cache);\n assertNotNull(cache.getOwnedBundles());\n }", "class_method_signature": "OwnershipCacheTest.testConstructor()", "constructor":...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OwnershipCache.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(OwnershipCache.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "public Map<String, OwnedBundle> getOwnedBundles() {\n return this.ownedBundlesCache.synchronous().asMap();\n }", "class_method_signature": "OwnershipCache.getOwnedBundles()", "constructor": false, "full_signature": "public Map<String, OwnedBundle> getOwnedBundles()", "identifier": "getOwn...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_68
{ "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 testConsumerBuilderImplWhenBatchReceivePolicyIsNotValid() {\n consumerBuilderImpl.batchReceivePolicy(BatchReceivePolicy.builder()\n .maxNumMessages(0)\n .maxNumBytes(0)\n .timeout...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClientImpl client;", "type": "PulsarClientImpl", "var_name": "client" }, { "declarator": "conf", "modifier": "private", "original_string": "private C...
{ "body": "public ConsumerBuilder<T> batchReceivePolicy(BatchReceivePolicy batchReceivePolicy) {\n checkArgument(batchReceivePolicy != null, \"batchReceivePolicy must not be null.\");\n batchReceivePolicy.verify();\n conf.setBatchReceivePolicy(batchReceivePolicy);\n return this;\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_284
{ "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 testMergeDifferentResources() {\n SinkConfig sinkConfig = createSinkConfig();\n Resources resources = new Resources();\n resources.setCpu(0.3);\n resources.setRam(1232l);\n resources.setDisk(123456l);\n SinkConfig newSinkConfig = createUpdate...
{ "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_545
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentSortedLongPairSetTest.java", "identifier": "ConcurrentSortedLongPairSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testItems() {\n LongPairSet set = new ConcurrentSortedLongPairSet(16);\n\n int n = 100;\n int limit = 10;\n for (int i = 0; i < n; i++) {\n set.add(i, i);\n }\n\n Set<LongPair> items = set.items();\n Set<LongPair> limitItems...
{ "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 Set<LongPair> items() {\n return items((int) this.size());\n }", "class_method_signature": "ConcurrentSortedLongPairSet.items()", "constructor": false, "full_signature": "@Override public Set<LongPair> items()", "identifier": "items", "invocations": [ "items", ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_115
{ "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 maxLookupRedirectsTest2() throws Exception {\n Field field = BinaryProtoLookupService.class.getDeclaredField(\"maxLookupRedirects\");\n field.setAccessible(true);\n field.set(lookup, 2);\n\n Pair<InetSocketAddress, InetSocketAddre...
{ "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_400
{ "fields": [], "file": "pulsar-broker-common/src/test/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoaderTest.java", "identifier": "PulsarConfigurationLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPulsarConfiguraitonLoadingProp() throws Exception {\n final String zk = \"localhost:2184\";\n final Properties prop = new Properties();\n prop.setProperty(\"zookeeperServers\", zk);\n final ServiceConfiguration serviceConfig = PulsarConfigurationLoader...
{ "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 <T extends PulsarConfiguration> T create(String configFile,\n Class<? extends PulsarConfiguration> clazz) throws IOException, IllegalArgumentException {\n checkNotNull(configFile);\n return create(new FileInputStream(configFile), clazz);\n }", "class_method_signa...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_379
{ "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 testAuthenticateWhenNoJwtPassed() throws AuthenticationException {\n AuthenticationProviderToken provider = new AuthenticationProviderToken();\n provider.authenticate(new AuthenticationDataSource() {\n @Over...
{ "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_396
{ "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 testListenerWithoutNonTLSAddress() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setBrokerServicePortTls(Optional.of(6651));\n config.setAdvertisedListeners(\" internal:pulsar+ssl://127...
{ "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_44
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplTest.java", "identifier": "BatchMessageIdImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void equalsTest() {\n BatchMessageIdImpl batchMsgId1 = new BatchMessageIdImpl(0, 0, 0, 0);\n BatchMessageIdImpl batchMsgId2 = new BatchMessageIdImpl(1, 1, 1, 1);\n BatchMessageIdImpl batchMsgId3 = new BatchMessageIdImpl(0, 0, 0, 1);\n BatchMessageIdImpl batchMs...
{ "fields": [ { "declarator": "NO_BATCH = -1", "modifier": "private final static", "original_string": "private final static int NO_BATCH = -1;", "type": "int", "var_name": "NO_BATCH" }, { "declarator": "batchIndex", "modifier": "private final", "original_str...
{ "body": "@Override\n public boolean equals(Object obj) {\n if (obj instanceof BatchMessageIdImpl) {\n BatchMessageIdImpl other = (BatchMessageIdImpl) obj;\n return ledgerId == other.ledgerId && entryId == other.entryId && partitionIndex == other.partitionIndex\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_181
{ "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 testGetStateStateDisabled() {\n context.getState(\"test-key\");\n }", "class_method_signature": "ContextImplTest.testGetStateStateDisabled()", "constructor": false, "full_signature": "@Test(expectedExceptions = Illegal...
{ "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 ByteBuffer getState(String key) {\n ensureStateEnabled();\n try {\n return result(stateContext.get(key));\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to retrieve the state value for key '\" + key + \"'\", e);\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_494
{ "fields": [], "file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/AvroSerializationSchemaTest.java", "identifier": "AvroSerializationSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAvroSerializationSchemaWithEmptyRecord() throws IOException {\n NasaMission nasaMission = NasaMission.newBuilder().setId(1).setName(\"Mercury program\").setStartYear(null).setEndYear(null).build();\n AvroSerializationSchema schema = new AvroSerializationSchema();\n ...
{ "fields": [ { "declarator": "serialVersionUID = -6691140169413760919L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -6691140169413760919L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "pulsar-flink/sr...
{ "body": "@Override\n public byte[] serialize(T t) {\n if (null == t) {\n return null;\n }\n\n // Writer to serialize Avro record into a byte array.\n DatumWriter<T> writer = new SpecificDatumWriter<>(t.getSchema());\n // Output stream to serialize records into byte a...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_247
{ "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 = \"AutoAck cannot be altered\")\n public void testMergeDifferentAutoAck() {\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_302
{ "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 testSmallBlockSizeConfigured() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"s3\");\n conf.setS3ManagedLedgerOffloadRegion(\"eu-west-1\");\n conf.setS3ManagedLedgerOffloadBucket(BUCKET);\n ...
{ "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_586
{ "fields": [ { "declarator": "defaultPolicyJson = \"{\\\"namespaces\\\":[\\\"pulsar/use/test.*\\\"],\\\"primary\\\":[\\\"prod1-broker[1-3].messaging.use.example.com\\\"],\\\"secondary\\\":[\\\"prod1-broker.*.use.example.com\\\"],\\\"auto_failover_policy\\\":{\\\"policy_type\\\":\\\"min_available\\\",\\\"pa...
{ "body": "@Test\n public void testGetAvailablePrimaryBrokers() throws Exception {\n NamespaceIsolationPolicyImpl defaultPolicy = this.getDefaultPolicy();\n SortedSet<BrokerStatus> brokerStatus = new TreeSet<>();\n SortedSet<BrokerStatus> expectedAvailablePrimaries = new TreeSet<>();\n ...
{ "fields": [ { "declarator": "namespaces", "modifier": "private", "original_string": "private List<String> namespaces;", "type": "List<String>", "var_name": "namespaces" }, { "declarator": "primary", "modifier": "private", "original_string": "private List<S...
{ "body": "@Override\n public SortedSet<BrokerStatus> getAvailablePrimaryBrokers(SortedSet<BrokerStatus> primaryCandidates) {\n SortedSet<BrokerStatus> availablePrimaries = new TreeSet<BrokerStatus>();\n for (BrokerStatus status : primaryCandidates) {\n if (this.autoFailoverPolicy.isBroker...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_13
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImplTest.java", "identifier": "MultiTopicsConsumerImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(timeOut = 5000)\n public void testParallelSubscribeAsync() throws Exception {\n String topicName = \"parallel-subscribe-async-topic\";\n String subscriptionName = \"parallel-subscribe-async-subscription\";\n String serviceUrl = \"pulsar://localhost:6650\";\n Schema<byte...
{ "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": "public CompletableFuture<Void> subscribeAsync(String topicName, boolean createTopicIfDoesNotExist) {\n TopicName topicNameInstance = getTopicName(topicName);\n if (topicNameInstance == null) {\n return FutureUtil.failedFuture(\n new PulsarClientException.AlreadyC...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_139
{ "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 testReadEos() throws Exception {\n DistributedLogManager dlm = mock(DistributedLogManager.class);\n LogReader reader = mock(LogReader.class);\n when(dlm.getInputStream(any(DLSN.class))).thenReturn(reader);\n when(reader.readNext(anyBoolean())).thenThrow(ne...
{ "fields": [ { "declarator": "currentLogRecord = null", "modifier": "private", "original_string": "private LogRecordWithInputStream currentLogRecord = null;", "type": "LogRecordWithInputStream", "var_name": "currentLogRecord" }, { "declarator": "dlm", "modifier":...
{ "body": "@Override\n public int read() throws IOException {\n byte[] b = new byte[1];\n if (read(b, 0, 1) != 1) {\n return -1;\n } else {\n return b[0];\n }\n }", "class_method_signature": "DLInputStream.read()", "constructor": false, "full_signature": "@Override public int read()", ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_569
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/PartitionedTopicStatsTest.java", "identifier": "PartitionedTopicStatsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPartitionedTopicStats() {\n PartitionedTopicStats partitionedTopicStats = new PartitionedTopicStats();\n partitionedTopicStats.msgRateIn = 1;\n partitionedTopicStats.msgThroughputIn = 1;\n partitionedTopicStats.msgRateOut = 1;\n partitionedTopic...
{ "fields": [ { "declarator": "metadata", "modifier": "public", "original_string": "public PartitionedTopicMetadata metadata;", "type": "PartitionedTopicMetadata", "var_name": "metadata" }, { "declarator": "partitions", "modifier": "public", "original_string...
{ "body": "public PartitionedTopicStats() {\n super();\n metadata = new PartitionedTopicMetadata();\n partitions = Maps.newHashMap();\n }", "class_method_signature": "PartitionedTopicStats.PartitionedTopicStats()", "constructor": true, "full_signature": "public PartitionedTopicStats()",...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_210
{ "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 testMergeEqual() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createSourceConfig();\n SourceConfig mergedConfig = SourceConfigUtils.validateUpdate(sourceConfig, newSourceConfig);\n assertEquals(\n ne...
{ "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_355
{ "fields": [], "file": "pulsar-io/kinesis/src/test/java/org/apache/pulsar/io/kinesis/KinesisSinkTest.java", "identifier": "KinesisSinkTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDefaultCredentialProvider() throws Exception {\n KinesisSink sink = new KinesisSink();\n Map<String, String> credentialParam = Maps.newHashMap();\n String awsCredentialPluginParam = new Gson().toJson(credentialParam);\n try {\n sink.defaultC...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(KinesisSink.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(KinesisSink.class);", "type": "Logger", "var_name": "LOG" }, { "declarator...
{ "body": "@Override\n public void close() throws IOException {\n if (kinesisProducer != null) {\n kinesisProducer.flush();\n kinesisProducer.destroy();\n }\n LOG.info(\"Kinesis sink stopped.\");\n }", "class_method_signature": "KinesisSink.close()", "constructor":...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_590
{ "fields": [], "file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/offload/OffloadUtilsTest.java", "identifier": "OffloadUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testOffloadMetadataShouldClearBeforeSet() {\n MLDataFormats.ManagedLedgerInfo.LedgerInfo.Builder builder =\n MLDataFormats.ManagedLedgerInfo.LedgerInfo.newBuilder();\n builder.setLedgerId(1L);\n\n Map<String, String> map = new HashMap<>();\n map.pu...
{ "fields": [], "file": "managed-ledger/src/main/java/org/apache/bookkeeper/mledger/offload/OffloadUtils.java", "identifier": "OffloadUtils", "interfaces": "", "methods": [ { "class_method_signature": "OffloadUtils.OffloadUtils()", "constructor": true, "full_signature": "private Offload...
{ "body": "public static void setOffloadDriverMetadata(LedgerInfo.Builder infoBuilder,\n String driverName,\n Map<String, String> offloadDriverMetadata) {\n infoBuilder.getOffloadContextBuilder()\n .getDriv...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_206
{ "fields": [ { "declarator": "TOPIC = \"persistent://sample/standalone/ns1/test_result\"", "modifier": "private static final", "original_string": "private static final String TOPIC = \"persistent://sample/standalone/ns1/test_result\";", "type": "String", "var_name": "TOPIC" } ...
{ "body": "@Test\n public void testComplexOuputType() throws PulsarClientException {\n PulsarSinkConfig pulsarConfig = getPulsarConfigs();\n // set type to void\n pulsarConfig.setTypeClassName(ComplexUserDefinedType.class.getName());\n pulsarConfig.setSerdeClassName(ComplexSerDe.class.g...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClient client;", "type": "PulsarClient", "var_name": "client" }, { "declarator": "pulsarSinkConfig", "modifier": "private final", "original_string": ...
{ "body": "@SuppressWarnings(\"unchecked\")\n @VisibleForTesting\n Schema<T> initializeSchema() throws ClassNotFoundException {\n if (StringUtils.isEmpty(this.pulsarSinkConfig.getTypeClassName())) {\n return (Schema<T>) Schema.BYTES;\n }\n\n Class<?> typeArg = Reflections.loadCla...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_1
{ "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 testPulsarKafkaSendAvro() throws PulsarClientException {\n // Arrange\n PulsarClient mockClient = mock(PulsarClient.class);\n ProducerBuilder mockProducerBuilder = mock(ProducerBuilder.class);\n org.apache.pulsar.client.api.Producer mockProducer = mock(org...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClient client;", "type": "PulsarClient", "var_name": "client" }, { "declarator": "pulsarProducerBuilder", "modifier": "private final", "original_stri...
{ "body": "@Override\n public Future<RecordMetadata> send(ProducerRecord<K, V> producerRecord) {\n return send(producerRecord, null);\n }", "class_method_signature": "PulsarKafkaProducer.send(ProducerRecord<K, V> producerRecord)", "constructor": false, "full_signature": "@Override public Future<Rec...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_343
{ "fields": [ { "declarator": "eb", "modifier": "private", "original_string": "private EventBus eb;", "type": "EventBus", "var_name": "eb" }, { "declarator": "es", "modifier": "private", "original_string": "private EventSync es;", "type": "EventSync", ...
{ "body": "@Test\n public void testPolling() throws Exception {\n es.awaitEvent();\n es.reset();\n\n FlumeConfiguration fc = cp.getFlumeConfiguration();\n Assert.assertTrue(fc.getConfigurationErrors().isEmpty());\n AgentConfiguration ac = fc.getConfigurationFor(AGENT_NAME);\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory\n .getLogger(PollingZooKeeperConfigurationProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory\n .getLogger(PollingZooKeeperConfigurationProvider.cl...
{ "body": "@Override\n protected FlumeConfiguration getFlumeConfiguration() {\n return flumeConfiguration;\n }", "class_method_signature": "PollingZooKeeperConfigurationProvider.getFlumeConfiguration()", "constructor": false, "full_signature": "@Override protected FlumeConfiguration getFlumeConfigu...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_197
{ "fields": [ { "declarator": "testBatchSource", "modifier": "private", "original_string": "private TestBatchSource testBatchSource;", "type": "TestBatchSource", "var_name": "testBatchSource" }, { "declarator": "testBatchPushSource", "modifier": "private", "...
{ "body": "@Test\n public void testPushOpenWithRightSource() throws Exception {\n batchSourceExecutor.open(pushConfig, context);\n }", "class_method_signature": "BatchSourceExecutorTest.testPushOpenWithRightSource()", "constructor": false, "full_signature": "@Test public void testPushOpenWithRightSource()"...
{ "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_52
{ "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 testGetAuthData() throws Exception {\n AuthenticationDataProvider data;\n TokenResult tr = TokenResult.builder().accessToken(TEST_ACCESS_TOKEN).expiresIn(TEST_EXPIRES_IN).build();\n doReturn(tr).when(this.flow).authenticate();\n data = this.auth.getAuthDat...
{ "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 synchronized AuthenticationDataProvider getAuthData() throws PulsarClientException {\n if (this.cachedToken == null || this.cachedToken.isExpired()) {\n TokenResult tr = this.flow.authenticate();\n this.cachedToken = new CachedToken(tr);\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_178
{ "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 testGetCounterStateDisabled() {\n context.getCounter(\"test-key\");\n }", "class_method_signature": "ContextImplTest.testGetCounterStateDisabled()", "constructor": false, "full_signature": "@Test(expectedExceptions = I...
{ "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 long getCounter(String key) {\n ensureStateEnabled();\n try {\n return result(stateContext.getCounter(key));\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to retrieve counter from key '\" + key + \"'\");\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_482
{ "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 testFindBundle() throws Exception {\n SortedSet<Long> partitions = Sets.newTreeSet();\n partitions.add(0l);\n partitions.add(0x40000000l);\n partitions.add(0xa0000000l);\n partitions.add(0xb0000000l);\n partitions.add(0xc0000000l);\n p...
{ "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 NamespaceBundle findBundle(TopicName topicName) {\n checkArgument(this.nsname.equals(topicName.getNamespaceObject()));\n long hashCode = factory.getLongHashCode(topicName.toString());\n NamespaceBundle bundle = getBundle(hashCode);\n if (topicName.getDomain().equals(Topic...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_528
{ "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 testCreateTypedInstanceConstructorThrowsException() {\n try {\n createInstance(ThrowExceptionClass.class.getName(), aInterface.class, classLoader);\n fail(\"Should fail to load class whose constructor throws exceptions\");\n } catch (RuntimeExcepti...
{ "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_251
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeDifferentParallelism() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"parallelism\", 101);\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionConfig, ...
{ "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_314
{ "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(expectedExceptions = UnrecognizedPropertyException.class)\n public void testNettyTcpConfigLoadWithMapWhenInvalidPropertyIsSet() throws IOException {\n Map<String, Object> map = new HashMap<>();\n map.put(\"invalidProperty\", 1);\n\n NettySourceConfig.load(map);\n }", "cla...
{ "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_466
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java", "identifier": "RestExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRestException() {\n RestException re = new RestException(Status.TEMPORARY_REDIRECT, \"test rest exception\");\n RestException testException = new RestException(re);\n\n assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(), testException.getResponse().getSta...
{ "fields": [], "file": "pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java", "identifier": "RestException", "interfaces": "", "methods": [ { "class_method_signature": "RestException.getExceptionData(Throwable t)", "constructor": false, "full_signature": "static ...
{ "body": "public RestException(Response.Status status, String message) {\n this(status.getStatusCode(), message);\n }", "class_method_signature": "RestException.RestException(Response.Status status, String message)", "constructor": true, "full_signature": "public RestException(Response.Status status...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_59
{ "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 testConsumerBuilderImplWhenTopicNamesIsEmpty() {\n consumerBuilderImpl.topics(Arrays.asList());\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenTopicNamesIsEmpty()", "constructor": ...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClientImpl client;", "type": "PulsarClientImpl", "var_name": "client" }, { "declarator": "conf", "modifier": "private", "original_string": "private C...
{ "body": "@Override\n public ConsumerBuilder<T> topics(List<String> topicNames) {\n checkArgument(topicNames != null && !topicNames.isEmpty(),\n \"Passed in topicNames list should not be null or empty.\");\n topicNames.stream().forEach(topicName ->\n checkArgument(Strin...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_523
{ "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 testCreateInstanceNoNoArgConstructor() {\n try {\n createInstance(OneArgClass.class.getName(), classLoader);\n fail(\"Should fail to load class doesn't have no-arg constructor\");\n } catch (RuntimeException re) {\n assertTrue(re.getCaus...
{ "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_173
{ "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 testChoosePartitionWithoutKeyWithoutSequenceId() {\n Message<?> msg = mock(Message.class);\n when(msg.hasKey()).thenReturn(false);\n when(msg.getKey()).thenReturn(null);\n when(msg.getSequenceId()).thenReturn(-1L);\n TopicMetadata topicMetadata = mo...
{ "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_489
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java", "identifier": "PulsarBrokerStarterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMainRunBookieRecoveryNoConfig() throws Exception {\n try {\n File testConfigFile = createValidBrokerConfigFile();\n String[] args = {\"-c\", testConfigFile.getAbsolutePath(), \"-ra\", \"-bc\", \"\"};\n PulsarBrokerStarter.main(args);\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);", "type": "Logger", "var_name": "log" } ], "...
{ "body": "public static void main(String[] args) throws Exception {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss,SSS\");\n Thread.setDefaultUncaughtExceptionHandler((thread, exception) -> {\n System.out.println(String.format(\"%s [%s] error Uncaught exception in threa...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_431
{ "fields": [ { "declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"", "modifier": "private final", "original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";", "type": "String", "var_nam...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Test\n public void testTlsAuthAllowInsecure() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n final String subName = \"newSub\";\n Authentication auth;\n\n Set<String> providers = new HashSet<>();...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BrokerService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@Override\n public void close() throws IOException {\n log.info(\"Shutting down Pulsar Broker service\");\n\n if (pulsar.getConfigurationCache() != null) {\n pulsar.getConfigurationCache().policiesCache().unregisterListener(this);\n }\n\n // unloads all namespaces ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_124
{ "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 testPositiveNumber() {\n TestConfig testConfig = createGoodConfig();\n testConfig.positiveNumber = -2;\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage().contains(\"p...
{ "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_574
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/ReplicatorStatsTest.java", "identifier": "ReplicatorStatsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReplicatorStatsNull() {\n ReplicatorStats rs = new ReplicatorStats();\n try {\n rs.add(null);\n Assert.fail(\"Must fail.\");\n } catch (NullPointerException ne) {\n // ok\n }\n }", "class_method_signature": "Replic...
{ "fields": [ { "declarator": "msgRateIn", "modifier": "public", "original_string": "public double msgRateIn;", "type": "double", "var_name": "msgRateIn" }, { "declarator": "msgThroughputIn", "modifier": "public", "original_string": "public double msgThrough...
{ "body": "public ReplicatorStats add(ReplicatorStats stats) {\n checkNotNull(stats);\n this.msgRateIn += stats.msgRateIn;\n this.msgThroughputIn += stats.msgThroughputIn;\n this.msgRateOut += stats.msgRateOut;\n this.msgThroughputOut += stats.msgThroughputOut;\n this.msgRate...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_348
{ "fields": [], "file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java", "identifier": "TestAbstractConfigurationProvider", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSourceThrowsExceptionDuringConfiguration() throws Exception {\n String agentName = \"agent1\";\n String sourceType = UnconfigurableSource.class.getName();\n String channelType = \"memory\";\n String sinkType = \"null\";\n Map<String, String> pro...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);", "type": "Logger", "var_n...
{ "body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_427
{ "fields": [ { "declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"", "modifier": "private final", "original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";", "type": "String", "var_nam...
{ "body": "@Test\n public void testStatsOfStorageSizeWithSubscription() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/no-subscription\";\n Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName).create();\n PersistentTopic topicRef = (PersistentTopic)...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BrokerService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "public Optional<Topic> getTopicReference(String topic) {\n CompletableFuture<Optional<Topic>> future = topics.get(topic);\n if (future != null && future.isDone() && !future.isCompletedExceptionally()) {\n return future.join();\n } else {\n return Optional.empty(...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_18
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/SinglePartitionMessageRouterImplTest.java", "identifier": "SinglePartitionMessageRouterImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChoosePartitionWithoutKey() {\n Message<?> msg = mock(Message.class);\n when(msg.getKey()).thenReturn(null);\n\n SinglePartitionMessageRouterImpl router = new SinglePartitionMessageRouterImpl(1234, HashingScheme.JavaStringHash);\n assertEquals(1234, ro...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "partitionIndex", "modifier": "priva...
{ "body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata metadata) {\n // If the message has a key, it supersedes the single partition routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), metadata.numPartitions());\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_562
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/FileModifiedTimeUpdaterTest.java", "identifier": "FileModifiedTimeUpdaterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(dataProvider = \"files\")\n public void testFileNotModified(String fileName) throws IOException {\n Path path = Paths.get(fileName);\n createFile(path);\n FileModifiedTimeUpdater fileModifiedTimeUpdater = new FileModifiedTimeUpdater(fileName);\n FileTime fileTime = file...
{ "fields": [ { "declarator": "fileName", "modifier": "@Getter", "original_string": "@Getter\n String fileName;", "type": "String", "var_name": "fileName" }, { "declarator": "lastModifiedTime", "modifier": "@Getter", "original_string": "@Getter\n FileT...
{ "body": "public boolean checkAndRefresh() {\n FileTime newLastModifiedTime = updateLastModifiedTime();\n if (newLastModifiedTime != null && !newLastModifiedTime.equals(lastModifiedTime)) {\n this.lastModifiedTime = newLastModifiedTime;\n return true;\n }\n return fa...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_132
{ "fields": [], "file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/FunctionAssignmentTailerTest.java", "identifier": "FunctionAssignmentTailerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(timeOut = 10000)\n public void testTriggerReadToTheEndAndExit() throws Exception {\n WorkerConfig workerConfig = new WorkerConfig();\n workerConfig.setWorkerId(\"worker-1\");\n workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());\n work...
{ "fields": [ { "declarator": "functionRuntimeManager", "modifier": "private final", "original_string": "private final FunctionRuntimeManager functionRuntimeManager;", "type": "FunctionRuntimeManager", "var_name": "functionRuntimeManager" }, { "declarator": "readerBuild...
{ "body": "public synchronized CompletableFuture<Void> triggerReadToTheEndAndExit() {\n exitOnEndOfTopic = true;\n return this.exitFuture;\n }", "class_method_signature": "FunctionAssignmentTailer.triggerReadToTheEndAndExit()", "constructor": false, "full_signature": "public synchronized Comple...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_470
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java", "identifier": "BookKeeperClientFactoryImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetDefaultEnsemblePlacementPolicyRackAwareEnabled() {\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();\n AtomicReference<ZooKeeperCache> clientIsolationZkCache = new AtomicReference<>();\n ClientConfiguration bkConf = new Cl...
{ "fields": [ { "declarator": "rackawarePolicyZkCache = new AtomicReference<>()", "modifier": "private final", "original_string": "private final AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();", "type": "AtomicReference<ZooKeeperCache>", "var_name": ...
{ "body": "public static void setDefaultEnsemblePlacementPolicy(\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache,\n AtomicReference<ZooKeeperCache> clientIsolationZkCache,\n ClientConfiguration bkConf,\n ServiceConfiguration conf,\n ZooKeeper zkClient\n ) {\n if (...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_165
{ "fields": [ { "declarator": "waterMarkEventGenerator", "modifier": "private", "original_string": "private WaterMarkEventGenerator<Integer> waterMarkEventGenerator;", "type": "WaterMarkEventGenerator<Integer>", "var_name": "waterMarkEventGenerator" }, { "declarator": "...
{ "body": "@Test\n public void testNoEvents() throws Exception {\n waterMarkEventGenerator.run();\n assertTrue(eventList.isEmpty());\n }", "class_method_signature": "WaterMarkEventGeneratorTest.testNoEvents()", "constructor": false, "full_signature": "@Test public void testNoEvents()", "id...
{ "fields": [ { "declarator": "windowManager", "modifier": "private final", "original_string": "private final WindowManager<T> windowManager;", "type": "WindowManager<T>", "var_name": "windowManager" }, { "declarator": "eventTsLagMs", "modifier": "private final", ...
{ "body": "@Override\n public void run() {\n // initialize the thread context\n ThreadContext.put(\"function\", WindowUtils.getFullyQualifiedName(\n context.getTenant(), context.getNamespace(), context.getFunctionName()));\n try {\n long waterMarkTs = computeWaterMark...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_535
{ "fields": [ { "declarator": "channel", "modifier": "@Mock\n private", "original_string": "@Mock\n private Channel channel;", "type": "Channel", "var_name": "channel" }, { "declarator": "eventLoop", "modifier": "private", "original_string": "private D...
{ "body": "@Test\n public void toCompletableFuture_shouldCompleteSuccessfully_channelFutureCompletedBefore() throws Exception {\n channelFuture.setSuccess();\n Assert.assertEquals(ChannelFutures.toCompletableFuture(channelFuture).get(1, TimeUnit.SECONDS), channel);\n }", "class_method_signature...
{ "fields": [], "file": "pulsar-common/src/main/java/org/apache/pulsar/common/util/netty/ChannelFutures.java", "identifier": "ChannelFutures", "interfaces": "", "methods": [ { "class_method_signature": "ChannelFutures.ChannelFutures()", "constructor": true, "full_signature": "private Ch...
{ "body": "public static CompletableFuture<Channel> toCompletableFuture(ChannelFuture channelFuture) {\n Objects.requireNonNull(channelFuture, \"channelFuture cannot be null\");\n\n CompletableFuture<Channel> adapter = new CompletableFuture<>();\n if (channelFuture.isDone()) {\n if (ch...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_309
{ "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 testSessionCredentialSupplier() throws Exception {\n PowerMockito.mockStatic(CredentialsUtil.class);\n PowerMockito.when(CredentialsUtil.getAWSCredentialProvider(any())).thenReturn(new AWSCredentialsProvider() {\n @Override\n public AWSCredentials ...
{ "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": "public static Supplier<Credentials> getCredentials(String driver,\n OffloadPolicies conf) throws IOException {\n // credentials:\n // for s3, get by DefaultAWSCredentialsProviderChain.\n // for gcs, use downloaded file 'google_creds.json', which contains service accou...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_34
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtilsTest.java", "identifier": "ConfigurationDataUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadProducerConfigurationData() {\n ProducerConfigurationData confData = new ProducerConfigurationData();\n confData.setProducerName(\"unset\");\n confData.setBatchingEnabled(true);\n confData.setBatchingMaxMessages(1234);\n confData.setAutoUpda...
{ "fields": [ { "declarator": "mapper = new FastThreadLocal<ObjectMapper>() {\n @Override\n protected ObjectMapper initialValue() throws Exception {\n return create();\n }\n }", "modifier": "private static final", "original_string": "private static final FastTh...
{ "body": "public static <T> T loadData(Map<String, Object> config,\n T existingData,\n Class<T> dataCls) {\n ObjectMapper mapper = getThreadLocal();\n try {\n String existingConfigJson = mapper.writeValueAsString(existingData);\...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_372
{ "fields": [ { "declarator": "log = Logger.get(TestPulsarSplitManager.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(TestPulsarSplitManager.class);", "type": "Logger", "var_name": "log" } ], "file": "pulsar-sql/p...
{ "body": "@Test(dataProvider = \"rewriteNamespaceDelimiter\", singleThreaded = true)\n public void testGetSplitNonSchema(String delimiter) throws Exception {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n TopicName topicName = NON_SCHEMA_TOPIC;\n setup();\n log.info(\"!----- t...
{ "fields": [ { "declarator": "connectorId", "modifier": "private final", "original_string": "private final String connectorId;", "type": "String", "var_name": "connectorId" }, { "declarator": "pulsarConnectorConfig", "modifier": "private final", "original_s...
{ "body": "@Override\n public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session,\n ConnectorTableLayoutHandle layout,\n ConnectorSplitManager.SplitSchedulingStrategy splitScheduling...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_237
{ "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 = \"isRegexPattern for input topic test-input cannot be altered\")\n public void testMergeDifferentInputSpecWithRegexChange() {\n FunctionConfig functionConfig = createFunctionConfig();\n Map<String,...
{ "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_519
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/RateLimiterTest.java", "identifier": "RateLimiterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAcquire() throws Exception {\n final long rateTimeMSec = 1000;\n final int permits = 100;\n RateLimiter rate = new RateLimiter(permits, rateTimeMSec, TimeUnit.MILLISECONDS);\n long start = System.currentTimeMillis();\n for (int i = 0; i < permit...
{ "fields": [ { "declarator": "executorService", "modifier": "private final", "original_string": "private final ScheduledExecutorService executorService;", "type": "ScheduledExecutorService", "var_name": "executorService" }, { "declarator": "rateTime", "modifier":...
{ "body": "public synchronized void acquire() throws InterruptedException {\n acquire(1);\n }", "class_method_signature": "RateLimiter.acquire()", "constructor": false, "full_signature": "public synchronized void acquire()", "identifier": "acquire", "invocations": [ "acquire" ], "modifiers...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_149
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/RuntimeUtilsTest.java", "identifier": "RuntimeUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getGoInstanceCmd() throws IOException {\n InstanceConfig instanceConfig = new InstanceConfig();\n instanceConfig.setClusterName(\"kluster\");\n instanceConfig.setInstanceId(3000);\n instanceConfig.setFunctionId(\"func-7734\");\n instanceConfig.setFu...
{ "fields": [ { "declarator": "FUNCTIONS_EXTRA_DEPS_PROPERTY = \"pulsar.functions.extra.dependencies.dir\"", "modifier": "private static final", "original_string": "private static final String FUNCTIONS_EXTRA_DEPS_PROPERTY = \"pulsar.functions.extra.dependencies.dir\";", "type": "String", ...
{ "body": "public static List<String> getGoInstanceCmd(InstanceConfig instanceConfig,\n String originalCodeFileName,\n String pulsarServiceUrl) throws IOException {\n final List<String> args = new LinkedList<>();\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_63
{ "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 testConsumerBuilderImplWhenPriorityLevelPropertyIsNegative() {\n consumerBuilderImpl.priorityLevel(-1);\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenPriorityLevelPropertyIsNegative...
{ "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> priorityLevel(int priorityLevel) {\n checkArgument(priorityLevel >= 0, \"priorityLevel needs to be >= 0\");\n conf.setPriorityLevel(priorityLevel);\n return this;\n }", "class_method_signature": "ConsumerBuilderImpl.priorityLevel(int priori...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_325
{ "fields": [ { "declarator": "defaultProps = new HashMap<>()", "modifier": "private", "original_string": "private Map<String, String> defaultProps = new HashMap<>();", "type": "Map<String, String>", "var_name": "defaultProps" }, { "declarator": "distributedConfig", ...
{ "body": "@Test\n public void testGetFromEmpty() throws Exception {\n assertTrue(offsetBackingStore.get(\n Arrays.asList(ByteBuffer.wrap(\"empty-key\".getBytes(UTF_8))),\n null\n ).get().isEmpty());\n }", "class_method_signature": "PulsarOffsetBackingStoreTest.testGetFromE...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private Map<ByteBuffer, ByteBuffer> data;", "type": "Map<ByteBuffer, ByteBuffer>", "var_name": "data" }, { "declarator": "client", "modifier": "private", "original_string": "pri...
{ "body": "@Override\n public Future<Map<ByteBuffer, ByteBuffer>> get(Collection<ByteBuffer> keys,\n Callback<Map<ByteBuffer, ByteBuffer>> callback) {\n CompletableFuture<Void> endFuture = new CompletableFuture<>();\n readToEnd(endFuture);\n re...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_260
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/ExceptionsTest.java", "identifier": "ExceptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRethrowRuntimeExceptionAsIOException() throws IOException {\n RuntimeException re = new RuntimeException(\"test\");\n try {\n rethrowIOException(re);\n fail(\"Should rethrow RuntimeException\");\n } catch (RuntimeException e) {\n ...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Exceptions.java", "identifier": "Exceptions", "interfaces": "", "methods": [ { "class_method_signature": "Exceptions.rethrowIOException(Throwable cause)", "constructor": false, "full_signature...
{ "body": "public static void rethrowIOException(Throwable cause)\n throws IOException {\n if (cause instanceof IOException) {\n throw (IOException) cause;\n } else if (cause instanceof RuntimeException) {\n throw (RuntimeException) cause;\n } else if (cause insta...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_75
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java", "identifier": "AvroSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllowNullEncodeAndDecode() {\n AvroSchema<Foo> avroSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n\n Foo foo1 = new Foo();\n foo1.setField1(\"foo1\");\n foo1.setField2(\"bar1\");\n foo1.setField4(new Bar())...
{ "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_299
{ "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 testBucketDoesNotExist() throws Exception {\n LedgerOffloader offloader = new BlobStoreManagedLedgerOffloader(blobStore, \"no-bucket\", scheduler,\n DEFAULT_BLOCK_SIZE, DEFAULT_READ_BUFFER_SIZE);\n try {\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);", "type": "Logger", "var_nam...
{ "body": "@Override\n public CompletableFuture<Void> offload(ReadHandle readHandle,\n UUID uuid,\n Map<String, String> extraMetadata) {\n CompletableFuture<Void> promise = new CompletableFuture<>();\n scheduler.choos...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_333
{ "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 loadFromYamlFileTest() throws IOException {\n File yamlFile = getFile(\"sinkConfig.yaml\");\n String path = yamlFile.getAbsolutePath();\n RedisSinkConfig config = RedisSinkConfig.load(path);\n assertNotNull(config);\n assertEquals(\"localhost:...
{ "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_276
{ "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 testMergeDifferentInputSpec() {\n SinkConfig sinkConfig = createSinkConfig();\n Map<String, ConsumerConfig> inputSpecs = new HashMap<>();\n inputSpecs.put(\"test-input\", ConsumerConfig.builder().isRegexPattern(true).serdeClassName(\"test-serde\").receiverQueueSi...
{ "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_558
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSetTest.java", "identifier": "ConcurrentLongPairSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testItems() {\n ConcurrentLongPairSet set = new ConcurrentLongPairSet();\n\n int n = 100;\n int limit = 10;\n for (int i = 0; i < n; i++) {\n set.add(i, i);\n }\n\n Set<LongPair> items = set.items();\n Set<LongPair> limitIte...
{ "fields": [ { "declarator": "EmptyItem = -1L", "modifier": "private static final", "original_string": "private static final long EmptyItem = -1L;", "type": "long", "var_name": "EmptyItem" }, { "declarator": "DeletedItem = -2L", "modifier": "private static final"...
{ "body": "public Set<LongPair> items() {\n Set<LongPair> items = new HashSet<>();\n forEach((item1, item2) -> items.add(new LongPair(item1, item2)));\n return items;\n }", "class_method_signature": "ConcurrentLongPairSet.items()", "constructor": false, "full_signature": "public Set<Long...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...