id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
62117812_10 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/ProducerStatsRecorderImplTest.java",
"identifier": "ProducerStatsRecorderImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrementNumAcksReceived() throws Exception {\n ClientConfigurationData conf = new ClientConfigurationData();\n conf.setStatsIntervalSeconds(1);\n PulsarClientImpl client = mock(PulsarClientImpl.class);\n when(client.getConfiguration()).thenReturn(conf... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "stat",
"modifier": "private",
... | {
"body": "@Override\n public void incrementNumAcksReceived(long latencyNs) {\n numAcksReceived.increment();\n synchronized (ds) {\n ds.update(TimeUnit.NANOSECONDS.toMillis(latencyNs));\n }\n }",
"class_method_signature": "ProducerStatsRecorderImpl.incrementNumAcksReceived(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"
... |
62117812_585 | {
"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 testShouldFailover() throws Exception {\n NamespaceIsolationPolicyImpl defaultPolicy = this.getDefaultPolicy();\n SortedSet<BrokerStatus> brokerStatus = new TreeSet<>();\n for (int i = 0; i < 10; i++) {\n BrokerStatus status = new BrokerStatus(String.f... | {
"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 boolean shouldFailover(SortedSet<BrokerStatus> brokerStatus) {\n return this.autoFailoverPolicy.shouldFailoverToSecondary(brokerStatus);\n }",
"class_method_signature": "NamespaceIsolationPolicyImpl.shouldFailover(SortedSet<BrokerStatus> brokerStatus)",
"constructor": fa... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_356 | {
"fields": [],
"file": "pulsar-io/kinesis/src/test/java/org/apache/pulsar/io/kinesis/KinesisSinkTest.java",
"identifier": "KinesisSinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCredentialProvider() throws Exception {\n KinesisSink sink = new KinesisSink();\n\n final String accesKey = \"ak\";\n final String secretKey = \"sk\";\n Map<String, String> credentialParam = Maps.newHashMap();\n credentialParam.put(KinesisSink.A... | {
"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_213 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Tenants differ\")\n public void testMergeDifferentTenant() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"tenant\", \"Different... | {
"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_439 | {
"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 testCreateProducerTimeout() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Delay the topic creation in a deterministic way\n CompletableFuture<Runnable> openTopicFuture = new CompletableFuture<>();\n doAnswer(i... | {
"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_593 | {
"fields": [],
"file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/MetaStoreImplTest.java",
"identifier": "MetaStoreImplTest",
"interfaces": "",
"superclass": "extends MockedBookKeeperTestCase"
} | {
"body": "@Test\n void getMLList() throws Exception {\n MetaStore store = new MetaStoreImpl(new ZKMetadataStore(zkc), executor);\n\n zkc.failConditional(Code.CONNECTIONLOSS, (op, path) -> {\n return op == MockZooKeeper.Op.GET_CHILDREN\n && path.equals(\"/managed-led... | {
"fields": [
{
"declarator": "BASE_NODE = \"/managed-ledgers\"",
"modifier": "private static final",
"original_string": "private static final String BASE_NODE = \"/managed-ledgers\";",
"type": "String",
"var_name": "BASE_NODE"
},
{
"declarator": "PREFIX = BASE_NODE + \... | {
"body": "@Override\n public Iterable<String> getManagedLedgers() throws MetaStoreException {\n try {\n return store.getChildren(BASE_NODE).join();\n } catch (CompletionException e) {\n throw getException(e);\n }\n }",
"class_method_signature": "MetaStoreImpl.getMan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_2 | {
"fields": [
{
"declarator": "BROKER_URL = \"metadata.broker.list\"",
"modifier": "private static final",
"original_string": "private static final String BROKER_URL = \"metadata.broker.list\";",
"type": "String",
"var_name": "BROKER_URL"
},
{
"declarator": "PRODUCER_TY... | {
"body": "@Test\n public void testPulsarKafkaProducerWithDefaultConfig() throws Exception {\n // https://kafka.apache.org/08/documentation.html#producerconfigs\n Properties properties = new Properties();\n properties.put(BROKER_URL, \"http://localhost:8080/\");\n\n ProducerConfig confi... | {
"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": "@VisibleForTesting\n public ProducerBuilder<byte[]> getPulsarProducerBuilder() {\n return pulsarProducerBuilder;\n }",
"class_method_signature": "PulsarKafkaProducer.getPulsarProducerBuilder()",
"constructor": false,
"full_signature": "@VisibleForTesting public ProducerBuilder<byte[]> 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_205 | {
"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 testExplicitDefaultSerDe() throws PulsarClientException {\n PulsarSinkConfig pulsarConfig = getPulsarConfigs();\n // set type to void\n pulsarConfig.setTypeClassName(String.class.getName());\n pulsarConfig.setSerdeClassName(TopicSchema.DEFAULT_SERDE);\n ... | {
"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_481 | {
"fields": [
{
"declarator": "factory = getNamespaceBundleFactory()",
"modifier": "private final",
"original_string": "private final NamespaceBundleFactory factory = getNamespaceBundleFactory();",
"type": "NamespaceBundleFactory",
"var_name": "factory"
}
],
"file": "pulsar-b... | {
"body": "@Test\n public void testToString() throws Exception {\n NamespaceBundle bundle0 = factory.getBundle(NamespaceName.get(\"pulsar/use/ns1\"),\n Range.range(0l, BoundType.CLOSED, 0x10000000L, BoundType.OPEN));\n assertEquals(bundle0.toString(), \"pulsar/use/ns1/0x00000000_0x1000... | {
"fields": [
{
"declarator": "nsname",
"modifier": "private final",
"original_string": "private final NamespaceName nsname;",
"type": "NamespaceName",
"var_name": "nsname"
},
{
"declarator": "keyRange",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Override\n public String toString() {\n return getKey(this.nsname, this.keyRange);\n }",
"class_method_signature": "NamespaceBundle.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"getKey"
],... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_51 | {
"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 testStart() throws Exception {\n this.auth.start();\n verify(this.flow).initialize();\n }",
"class_method_signature": "AuthenticationOAuth2Test.testStart()",
"constructor": false,
"full_signature": "@Test public void testStart()",
"identifier": "testStart",
... | {
"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 start() throws PulsarClientException {\n flow.initialize();\n }",
"class_method_signature": "AuthenticationOAuth2.start()",
"constructor": false,
"full_signature": "@Override public void start()",
"identifier": "start",
"invocations": [
"initialize"
],
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_194 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Bad config passed to TestBatchSource\")\n public void testWithoutRightSourceConfig() throws Exception {\n config.remove(\"foo\");\n config.put(\"something\", \"else\");\n batchSourceExecutor.open(config... | {
"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_317 | {
"fields": [],
"file": "pulsar-io/netty/src/test/java/org/apache/pulsar/io/netty/tcp/NettyTCPChannelInitializerTest.java",
"identifier": "NettyTCPChannelInitializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChannelInitializer() throws Exception {\n NioSocketChannel channel = new NioSocketChannel();\n\n NettyTCPChannelInitializer nettyChannelInitializer = new NettyTCPChannelInitializer(\n new NettyTCPServerHandler(new NettySource()));\n nettyChanne... | {
"fields": [
{
"declarator": "handler",
"modifier": "private",
"original_string": "private ChannelInboundHandlerAdapter handler;",
"type": "ChannelInboundHandlerAdapter",
"var_name": "handler"
}
],
"file": "pulsar-io/netty/src/main/java/org/apache/pulsar/io/netty/tcp/NettyTC... | {
"body": "@Override\n protected void initChannel(Channel channel) throws Exception {\n channel.pipeline().addLast(new ByteArrayDecoder());\n channel.pipeline().addLast(this.handler);\n }",
"class_method_signature": "NettyTCPChannelInitializer.initChannel(Channel channel)",
"constructor": fals... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_252 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentResources() {\n FunctionConfig functionConfig = createFunctionConfig();\n Resources resources = new Resources();\n resources.setCpu(0.3);\n resources.setRam(1232l);\n resources.setDisk(123456l);\n FunctionConfig newFunctionC... | {
"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_225 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/ActionsTest.java",
"identifier": "ActionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testActions() throws InterruptedException {\n\n // Test for success\n Supplier<Actions.ActionResult> supplier1 = mock(Supplier.class);\n when(supplier1.get()).thenReturn(Actions.ActionResult.builder().success(true).build());\n\n Supplier<Actions.ActionResu... | {
"fields": [
{
"declarator": "actions = new LinkedList<>()",
"modifier": "private",
"original_string": "private List<Action> actions = new LinkedList<>();",
"type": "List<Action>",
"var_name": "actions"
}
],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/fun... | {
"body": "private Actions() {\n\n }",
"class_method_signature": "Actions.Actions()",
"constructor": true,
"full_signature": "private Actions()",
"identifier": "Actions",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " Actions()",
"testcase": 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_360 | {
"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 testGetTableHandle(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n SchemaTableName schemaTableName = new SchemaTableName(TOPIC_1.getNamespace(), TOPIC_1.getLocalName());\n\n... | {
"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 ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName) {\n return new PulsarTableHandle(\n this.connectorId,\n tableName.getSchemaName(),\n tableName.getTableName(),\n tableName.getTab... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_419 | {
"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 testBrokersWithNoBundles() {\n LoadData loadData = new LoadData();\n\n LocalBrokerData broker1 = new LocalBrokerData();\n broker1.setBandwidthIn(new ResourceUsage(999, 1000));\n broker1.setBandwidthOut(new ResourceUsage(999, 1000));\n loadData.getBr... | {
"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_26 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/RoundRobinPartitionMessageRouterImplTest.java",
"identifier": "RoundRobinPartitionMessageRouterImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChoosePartitionWithNegativeTime() {\n Message<?> msg = mock(Message.class);\n when(msg.getKey()).thenReturn(null);\n\n // Fake clock, simulate timestamp that resolves into a negative Integer value\n Clock clock = mock(Clock.class);\n when(clock.... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "PARTITION_INDEX_UPDATER =\n At... | {
"body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata topicMetadata) {\n // If the message has a key, it supersedes the round robin routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), topicMetadata.numPartitions());\n }\n\... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_272 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Namespaces differ\")\n public void testMergeDifferentNamespace() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"namespace\", \"Different\")... | {
"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_337 | {
"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 loadFromYamlFileTest() throws IOException {\n File yamlFile = getFile(\"sinkConfig.yaml\");\n String path = yamlFile.getAbsolutePath();\n SolrSinkConfig config = SolrSinkConfig.load(path);\n assertNotNull(config);\n assertEquals(\"localhost:21... | {
"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_71 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java",
"identifier": "AvroSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSchemaDefinition() throws SchemaValidationException {\n org.apache.avro.Schema schema1 = ReflectData.get().getSchema(DefaultStruct.class);\n AvroSchema<StructWithAnnotations> schema2 = AvroSchema.of(StructWithAnnotations.class);\n\n String schemaDef1 = schema... | {
"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_264 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java",
"identifier": "WindowConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSettingSlidingTimeWindow() throws Exception {\n final Object[][] args = new Object[][]{\n {-1L, 10L},\n {10L, -1L},\n {0L, 10L},\n {10L, 0L},\n {0L, 0L},\n {-1L, -1L},\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_321 | {
"fields": [
{
"declarator": "mockSourceContext",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SourceContext mockSourceContext;",
"type": "SourceContext",
"var_name": "mockSourceContext"
},
{
"declarator": "mockMongoClient",
"modifier"... | {
"body": "@Test\n public void testWriteBadMessage() throws Exception {\n\n source.open(map, mockSourceContext);\n\n subscriber.onNext(new ChangeStreamDocument<Document>(null, new MongoNamespace(\"hello.pulsar\"),\n new Document(\"hello\", \"pulsar\"), new BsonDocument(\"_id\", new Bso... | {
"fields": [
{
"declarator": "clientProvider",
"modifier": "private final",
"original_string": "private final Supplier<MongoClient> clientProvider;",
"type": "Supplier<MongoClient>",
"var_name": "clientProvider"
},
{
"declarator": "mongoConfig",
"modifier": "priv... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n log.info(\"Open MongoDB Source\");\n\n mongoConfig = MongoConfig.load(config);\n mongoConfig.validate(false, false);\n\n if (clientProvider != null) {\n mongo... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_458 | {
"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 testDisableOwnership() throws Exception {\n OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory, nsService);\n\n NamespaceBundle testBundle = bundleFactory.getFullBundle(NamespaceName.get(\"pulsar/test/ns-1\"));\n assertFalse(cache.getOwnerAsync(... | {
"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 CompletableFuture<Void> disableOwnership(NamespaceBundle bundle) {\n String path = ServiceUnitZkUtils.path(bundle);\n CompletableFuture<Void> future = new CompletableFuture<>();\n\n updateBundleState(bundle, false)\n .thenRun(() -> {\n byte[] va... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_67 | {
"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 testConsumerBuilderImplWhenBatchReceivePolicyIsNull() {\n consumerBuilderImpl.batchReceivePolicy(null);\n }",
"class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenBatchReceivePolicyIsNull()",
... | {
"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_88 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java",
"identifier": "JSONSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllowNullCorrectPolymorphism() {\n Bar bar = new Bar();\n bar.setField1(true);\n\n DerivedFoo derivedFoo = new DerivedFoo();\n derivedFoo.setField1(\"foo1\");\n derivedFoo.setField2(\"bar2\");\n derivedFoo.setField3(4);\n derivedFo... | {
"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_399 | {
"fields": [],
"file": "pulsar-broker-common/src/test/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoaderTest.java",
"identifier": "PulsarConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPulsarConfiguraitonLoadingStream() throws Exception {\n File testConfigFile = new File(\"tmp.\" + System.currentTimeMillis() + \".properties\");\n if (testConfigFile.exists()) {\n testConfigFile.delete();\n }\n final String zkServer = \"z1.e... | {
"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_233 | {
"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 = \"Tenants differ\")\n public void testMergeDifferentTenant() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"tenant\",... | {
"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_376 | {
"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 testAuthenticateUnsignedToken() 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(\"t... | {
"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_30 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageAckerDisabledTest.java",
"identifier": "BatchMessageAckerDisabledTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAckIndividual() {\n for (int i = 0; i < 10; i++) {\n assertTrue(BatchMessageAckerDisabled.INSTANCE.ackIndividual(i));\n }\n }",
"class_method_signature": "BatchMessageAckerDisabledTest.testAckIndividual()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "INSTANCE = new BatchMessageAckerDisabled()",
"modifier": "static final",
"original_string": "static final BatchMessageAckerDisabled INSTANCE = new BatchMessageAckerDisabled();",
"type": "BatchMessageAckerDisabled",
"var_name": "INSTANCE"
}
],
"f... | {
"body": "@Override\n public boolean ackIndividual(int batchIndex) {\n return true;\n }",
"class_method_signature": "BatchMessageAckerDisabled.ackIndividual(int batchIndex)",
"constructor": false,
"full_signature": "@Override public boolean ackIndividual(int batchIndex)",
"identifier": "ackIndiv... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_248 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentMaxMessageRetries() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"maxMessageRetries\", 10);\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(funct... | {
"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_161 | {
"fields": [
{
"declarator": "testWindowedPulsarFunction",
"modifier": "private",
"original_string": "private TestWindowFunctionExecutor testWindowedPulsarFunction;",
"type": "TestWindowFunctionExecutor",
"var_name": "testWindowedPulsarFunction"
},
{
"declarator": "con... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testExecuteWithWrongJavaWindowFunctionType() throws Exception {\n WindowConfig windowConfig = new WindowConfig();\n windowConfig.setActualWindowFunctionClassName(TestWrongFunction.class.getName());\n Mockito.do... | {
"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_531 | {
"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 testClassInJarImplementsIface() {\n assertTrue(Reflections.classImplementsIface(aImplementation.class.getName(), aInterface.class));\n assertFalse(Reflections.classImplementsIface(aImplementation.class.getName(), bInterface.class));\n }",
"class_method_signature": ... | {
"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 classInJarImplementsIface(java.io.File jar, String fqcn, Class xface) {\n boolean ret = false;\n try {\n java.net.URLClassLoader loader = (URLClassLoader) ClassLoaderUtils.loadJar(jar);\n if (xface.isAssignableFrom(Class.forName(fqcn, false, loader)... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_474 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java",
"identifier": "BookKeeperClientFactoryImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSetMetadataServiceUri() {\n BookKeeperClientFactoryImpl factory = new BookKeeperClientFactoryImpl();\n ServiceConfiguration conf = new ServiceConfiguration();\n conf.setZookeeperServers(\"localhost:2181\");\n try {\n String defaultUri = \"zk... | {
"fields": [
{
"declarator": "rackawarePolicyZkCache = new AtomicReference<>()",
"modifier": "private final",
"original_string": "private final AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();",
"type": "AtomicReference<ZooKeeperCache>",
"var_name": ... | {
"body": "@VisibleForTesting\n ClientConfiguration createBkClientConfiguration(ServiceConfiguration conf) {\n ClientConfiguration bkConf = new ClientConfiguration();\n if (conf.getBookkeeperClientAuthenticationPlugin() != null\n && conf.getBookkeeperClientAuthenticationPlugin().trim()... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_566 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/net/ServiceURITest.java",
"identifier": "ServiceURITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testEmptyServiceUriString() {\n ServiceURI.create(\"\");\n }",
"class_method_signature": "ServiceURITest.testEmptyServiceUriString()",
"constructor": false,
"full_signature": "@Test(expectedExceptions = IllegalArgum... | {
"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_136 | {
"fields": [],
"file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/dlog/DLOutputStreamTest.java",
"identifier": "DLOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClose() throws Exception {\n DistributedLogManager dlm = mock(DistributedLogManager.class);\n AppendOnlyStreamWriter writer = mock(AppendOnlyStreamWriter.class);\n DLOutputStream out = new DLOutputStream(dlm, writer);\n\n out.close();\n verify(w... | {
"fields": [
{
"declarator": "dlm",
"modifier": "private final",
"original_string": "private final DistributedLogManager dlm;",
"type": "DistributedLogManager",
"var_name": "dlm"
},
{
"declarator": "writer",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public void close() throws IOException {\n writer.markEndOfStream();\n writer.close();\n dlm.close();\n }",
"class_method_signature": "DLOutputStream.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"invocations": [
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_423 | {
"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 testFilterRecentlyUnloaded() {\n int numBundles = 10;\n LoadData loadData = new LoadData();\n\n LocalBrokerData broker1 = new LocalBrokerData();\n broker1.setBandwidthIn(new ResourceUsage(999, 1000));\n broker1.setBandwidthOut(new ResourceUsage(999,... | {
"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_589 | {
"fields": [
{
"declarator": "numberOfThreads = 1000",
"modifier": "public final",
"original_string": "public final int numberOfThreads = 1000;",
"type": "int",
"var_name": "numberOfThreads"
},
{
"declarator": "counter = 0",
"modifier": "public",
"original_... | {
"body": "@Test(enabled = false)\n public void unlock() {\n ProtectedCode pc = new ProtectedCode();\n // Spawn many threads and start them all, all executing the same protected code\n // Not entirely sure if this models the main use case or idea.\n int i = 0;\n while (i < number... | {
"fields": [
{
"declarator": "semaphore = new Semaphore(1, true)",
"modifier": "private",
"original_string": "private Semaphore semaphore = new Semaphore(1, true);",
"type": "Semaphore",
"var_name": "semaphore"
},
{
"declarator": "owner",
"modifier": "",
"o... | {
"body": "public void unlock() {\n if (log.isDebugEnabled()) {\n owner = null;\n position = null;\n log.debug(\">>> Lock {} released at {}\", this.hashCode(),\n Thread.currentThread().getStackTrace()[2]);\n }\n\n semaphore.release();\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_209 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtilsTest.java",
"identifier": "FunctionMetaDataUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUpdate() {\n long version = 5;\n Function.FunctionMetaData existingMetaData = Function.FunctionMetaData.newBuilder().setFunctionDetails(\n Function.FunctionDetails.newBuilder().setName(\"func-1\").setParallelism(2)).setVersion(version).build();\n ... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtils.java",
"identifier": "FunctionMetaDataUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionMetaDataUtils.canChangeState(Function.FunctionMetaData functionMetaD... | {
"body": "public static Function.FunctionMetaData incrMetadataVersion(Function.FunctionMetaData existingMetaData,\n Function.FunctionMetaData updatedMetaData) {\n long version = 0;\n if (existingMetaData != null) {\n version = ex... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_120 | {
"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 testAppendWithKey() {\n final Appender appender = ctx.getConfiguration().getAppender(\"PulsarAppenderWithKey\");\n final LogEvent logEvent = createLogEvent();\n appender.append(logEvent);\n Message<byte[]> item;\n synchronized (history) {\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_570 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/PublisherStatsTest.java",
"identifier": "PublisherStatsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPublisherStatsAggregation() {\n PublisherStats stats1 = new PublisherStats();\n stats1.msgRateIn = 1;\n stats1.msgThroughputIn = 1;\n stats1.averageMsgSize = 1;\n\n PublisherStats stats2 = new PublisherStats();\n stats2.msgRateIn = 1;\n ... | {
"fields": [
{
"declarator": "count",
"modifier": "private",
"original_string": "private int count;",
"type": "int",
"var_name": "count"
},
{
"declarator": "msgRateIn",
"modifier": "public",
"original_string": "public double msgRateIn;",
"type": "doub... | {
"body": "public PublisherStats add(PublisherStats stats) {\n checkNotNull(stats);\n this.count++;\n this.msgRateIn += stats.msgRateIn;\n this.msgThroughputIn += stats.msgThroughputIn;\n double newAverageMsgSize = (this.averageMsgSize * (this.count - 1) + stats.averageMsgSize) / th... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_435 | {
"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 testProducerOnNotOwnedTopic() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Force the case where the broker doesn't own any topic\n doReturn(false).when(namespaceService).isServiceUnitActive(any(TopicName.class));\n\... | {
"fields": [
{
"declarator": "service",
"modifier": "private final",
"original_string": "private final BrokerService service;",
"type": "BrokerService",
"var_name": "service"
},
{
"declarator": "schemaService",
"modifier": "private final",
"original_string"... | {
"body": "public BrokerService getBrokerService() {\n return service;\n }",
"class_method_signature": "ServerCnx.getBrokerService()",
"constructor": false,
"full_signature": "public BrokerService getBrokerService()",
"identifier": "getBrokerService",
"invocations": [],
"modifiers": "public",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_527 | {
"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 testCreateTypedInstanceNoNoArgConstructor() {\n try {\n createInstance(OneArgClass.class.getName(), aInterface.class, classLoader);\n fail(\"Should fail to load class doesn't have no-arg constructor\");\n } catch (RuntimeException re) {\n ... | {
"fields": [
{
"declarator": "constructorCache =\n new ConcurrentHashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Constructor<?>> constructorCache =\n new ConcurrentHashMap<>();",
"type": "Map<Class<?>, Constructor<?>>"... | {
"body": "public static <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_177 | {
"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 testIncrCounterStateDisabled() {\n context.incrCounter(\"test-key\", 10);\n }",
"class_method_signature": "ContextImplTest.testIncrCounterStateDisabled()",
"constructor": false,
"full_signature": "@Test(expectedExcepti... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private InstanceConfig config;",
"type": "InstanceConfig",
"var_name": "config"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private Logger logger;"... | {
"body": "@Override\n public void incrCounter(String key, long amount) {\n ensureStateEnabled();\n try {\n result(stateContext.incrCounter(key, amount));\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to increment key '\" + key + \"' by amount '\" + amou... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_462 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/BrokerInterceptorUtilsTest.java",
"identifier": "BrokerInterceptorUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLoadBrokerEventListener() throws Exception {\n BrokerInterceptorDefinition def = new BrokerInterceptorDefinition();\n def.setInterceptorClass(MockBrokerInterceptor.class.getName());\n def.setDescription(\"test-broker-listener\");\n\n String archivePath... | {
"fields": [
{
"declarator": "BROKER_INTERCEPTOR_DEFINITION_FILE = \"broker_interceptor.yml\"",
"modifier": "final",
"original_string": "final String BROKER_INTERCEPTOR_DEFINITION_FILE = \"broker_interceptor.yml\";",
"type": "String",
"var_name": "BROKER_INTERCEPTOR_DEFINITION_FILE"... | {
"body": "BrokerInterceptorWithClassLoader load(BrokerInterceptorMetadata metadata, String narExtractionDirectory) throws IOException {\n NarClassLoader ncl = NarClassLoader.getFromArchive(\n metadata.getArchivePath().toAbsolutePath().toFile(),\n Collections.emptySet(),\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_198 | {
"fields": [
{
"declarator": "consumerConfigs = new HashMap<>()",
"modifier": "private static",
"original_string": "private static Map<String, ConsumerConfig> consumerConfigs = new HashMap<>();",
"type": "Map<String, ConsumerConfig>",
"var_name": "consumerConfigs"
},
{
... | {
"body": "@Test\n public void testVoidInputClasses() throws Exception {\n PulsarSourceConfig pulsarConfig = getPulsarConfigs(false);\n // set type to void\n pulsarConfig.setTypeClassName(Void.class.getName());\n\n @Cleanup\n PulsarSource<?> pulsarSource = new PulsarSource<>(getP... | {
"fields": [
{
"declarator": "pulsarClient",
"modifier": "private final",
"original_string": "private final PulsarClient pulsarClient;",
"type": "PulsarClient",
"var_name": "pulsarClient"
},
{
"declarator": "pulsarSourceConfig",
"modifier": "private final",
... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n // Setup schemas\n log.info(\"Opening pulsar source with config: {}\", pulsarSourceConfig);\n Map<String, ConsumerConfig<T>> configs = setupConsumerConfigs();\n\n for (M... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_526 | {
"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 testCreateTypedInstanceClassNotFound() {\n try {\n createInstance(\"notfound-class\", aInterface.class, classLoader);\n fail(\"Should fail to load notfound class\");\n } catch (RuntimeException re) {\n assertTrue(re.getCause() instanceof... | {
"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_176 | {
"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 testChoosePartitionWithKeySequenceId() {\n String key1 = \"key1\";\n String key2 = \"key2\";\n Message<?> msg1 = mock(Message.class);\n when(msg1.hasKey()).thenReturn(true);\n when(msg1.getKey()).thenReturn(key1);\n // make sure sequence id i... | {
"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_463 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/BrokerInterceptorUtilsTest.java",
"identifier": "BrokerInterceptorUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IOException.class)\n public void testLoadBrokerEventListenerWithBlankListerClass() throws Exception {\n BrokerInterceptorDefinition def = new BrokerInterceptorDefinition();\n def.setDescription(\"test-broker-listener\");\n\n String archivePath = \"/path/to... | {
"fields": [
{
"declarator": "BROKER_INTERCEPTOR_DEFINITION_FILE = \"broker_interceptor.yml\"",
"modifier": "final",
"original_string": "final String BROKER_INTERCEPTOR_DEFINITION_FILE = \"broker_interceptor.yml\";",
"type": "String",
"var_name": "BROKER_INTERCEPTOR_DEFINITION_FILE"... | {
"body": "BrokerInterceptorWithClassLoader load(BrokerInterceptorMetadata metadata, String narExtractionDirectory) throws IOException {\n NarClassLoader ncl = NarClassLoader.getFromArchive(\n metadata.getArchivePath().toAbsolutePath().toFile(),\n Collections.emptySet(),\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_199 | {
"fields": [
{
"declarator": "consumerConfigs = new HashMap<>()",
"modifier": "private static",
"original_string": "private static Map<String, ConsumerConfig> consumerConfigs = new HashMap<>();",
"type": "Map<String, ConsumerConfig>",
"var_name": "consumerConfigs"
},
{
... | {
"body": "@Test\n public void testInconsistentInputType() throws Exception {\n PulsarSourceConfig pulsarConfig = getPulsarConfigs(false);\n // set type to be inconsistent to that of SerDe\n pulsarConfig.setTypeClassName(Integer.class.getName());\n Map<String, ConsumerConfig> topicSerde... | {
"fields": [
{
"declarator": "pulsarClient",
"modifier": "private final",
"original_string": "private final PulsarClient pulsarClient;",
"type": "PulsarClient",
"var_name": "pulsarClient"
},
{
"declarator": "pulsarSourceConfig",
"modifier": "private final",
... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n // Setup schemas\n log.info(\"Opening pulsar source with config: {}\", pulsarSourceConfig);\n Map<String, ConsumerConfig<T>> configs = setupConsumerConfigs();\n\n for (M... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_121 | {
"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 testAppendWithKeyLookup() {\n final Appender appender = ctx.getConfiguration().getAppender(\"PulsarAppenderWithKeyLookup\");\n final LogEvent logEvent = createLogEvent();\n Date date = new Date();\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yy... | {
"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_571 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/BacklogQuotaTest.java",
"identifier": "BacklogQuotaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBacklogQuotaIdentity() {\n Assert.assertNotEquals(new BacklogQuota(1, RetentionPolicy.producer_exception),\n new BacklogQuota(2, RetentionPolicy.producer_exception));\n Assert.assertNotEquals(new BacklogQuota(1, RetentionPolicy.producer_exception),\n ... | {
"fields": [
{
"declarator": "limit",
"modifier": "private",
"original_string": "private long limit;",
"type": "long",
"var_name": "limit"
},
{
"declarator": "policy",
"modifier": "private",
"original_string": "private RetentionPolicy policy;",
"type"... | {
"body": "@Override\n public int hashCode() {\n return Objects.hash(Long.valueOf(limit), policy);\n }",
"class_method_signature": "BacklogQuota.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"invocations": [
"hash",
"va... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_434 | {
"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 testLookupThrottlingForClientByClient() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n\n PulsarClient pulsarClient = PulsarClient.builder()\n .serviceUrl(pulsar.getBrokerServiceUrl())\n .statsInterval... | {
"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_208 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtilsTest.java",
"identifier": "FunctionMetaDataUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChangeState() {\n long version = 5;\n Function.FunctionMetaData metaData = Function.FunctionMetaData.newBuilder().setFunctionDetails(\n Function.FunctionDetails.newBuilder().setName(\"func-1\").setParallelism(2)).setVersion(version).build();\n ... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionMetaDataUtils.java",
"identifier": "FunctionMetaDataUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionMetaDataUtils.canChangeState(Function.FunctionMetaData functionMetaD... | {
"body": "public static Function.FunctionMetaData changeFunctionInstanceStatus(Function.FunctionMetaData functionMetaData,\n Integer instanceId, boolean start) {\n Function.FunctionMetaData.Builder builder = functionMetaData.toBuilder()\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_567 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStatsTest.java",
"identifier": "PersistentOfflineTopicStatsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPersistentOfflineTopicStats() {\n PersistentOfflineTopicStats pot = new PersistentOfflineTopicStats(\"topic1\",\n \"prod1-broker1.messaging.use.example.com\");\n String cursor = \"cursor0\";\n long time = System.currentTimeMillis();\n po... | {
"fields": [
{
"declarator": "storageSize",
"modifier": "public",
"original_string": "public long storageSize;",
"type": "long",
"var_name": "storageSize"
},
{
"declarator": "totalMessages",
"modifier": "public",
"original_string": "public long totalMessage... | {
"body": "public PersistentOfflineTopicStats(String topicName, String brokerName) {\n this.brokerName = brokerName;\n this.topicName = topicName;\n this.dataLedgerDetails = Lists.newArrayList();\n this.cursorDetails = Maps.newHashMap();\n this.statGeneratedAt = new Date(System.curr... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_137 | {
"fields": [],
"file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/dlog/DLOutputStreamTest.java",
"identifier": "DLOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFlush() throws Exception {\n DistributedLogManager dlm = mock(DistributedLogManager.class);\n AppendOnlyStreamWriter writer = mock(AppendOnlyStreamWriter.class);\n DLOutputStream out = new DLOutputStream(dlm, writer);\n\n out.flush();\n verify(w... | {
"fields": [
{
"declarator": "dlm",
"modifier": "private final",
"original_string": "private final DistributedLogManager dlm;",
"type": "DistributedLogManager",
"var_name": "dlm"
},
{
"declarator": "writer",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public void flush() throws IOException {\n writer.force(false);\n }",
"class_method_signature": "DLOutputStream.flush()",
"constructor": false,
"full_signature": "@Override public void flush()",
"identifier": "flush",
"invocations": [
"force"
],
"modifiers": "@Override pu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_422 | {
"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 testBrokerWithMultipleBundles() {\n int numBundles = 10;\n LoadData loadData = new LoadData();\n\n LocalBrokerData broker1 = new LocalBrokerData();\n broker1.setBandwidthIn(new ResourceUsage(999, 1000));\n broker1.setBandwidthOut(new ResourceUsage(9... | {
"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_588 | {
"fields": [
{
"declarator": "numberOfThreads = 1000",
"modifier": "public final",
"original_string": "public final int numberOfThreads = 1000;",
"type": "int",
"var_name": "numberOfThreads"
},
{
"declarator": "counter = 0",
"modifier": "public",
"original_... | {
"body": "@Test\n public void lock() {\n\n final CallbackMutex cbm = new CallbackMutex();\n final Account salary = new Account();\n salary.add(1000);\n // No thread competition here\n // We will test thread competition in unlock()\n new Thread(() -> {\n cbm.loc... | {
"fields": [
{
"declarator": "semaphore = new Semaphore(1, true)",
"modifier": "private",
"original_string": "private Semaphore semaphore = new Semaphore(1, true);",
"type": "Semaphore",
"var_name": "semaphore"
},
{
"declarator": "owner",
"modifier": "",
"o... | {
"body": "public void lock() {\n semaphore.acquireUninterruptibly();\n\n if (log.isDebugEnabled()) {\n owner = Thread.currentThread().getName();\n position = Thread.currentThread().getStackTrace()[2].toString();\n log.debug(\"<<< Lock {} acquired at {}\", this.hashCode(... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_160 | {
"fields": [
{
"declarator": "testWindowedPulsarFunction",
"modifier": "private",
"original_string": "private TestWindowFunctionExecutor testWindowedPulsarFunction;",
"type": "TestWindowFunctionExecutor",
"var_name": "testWindowedPulsarFunction"
},
{
"declarator": "con... | {
"body": "@Test(expectedExceptions = RuntimeException.class)\n public void testExecuteWithWrongWrongTimestampExtractorType() throws Exception {\n WindowConfig windowConfig = new WindowConfig();\n windowConfig.setTimestampExtractorClassName(TestWrongTimestampExtractor.class.getName());\n Mocki... | {
"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_530 | {
"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 testCreateTypedInstanceUnassignableClass() {\n try {\n createInstance(aImplementation.class.getName(), bInterface.class, classLoader);\n fail(\"Should fail to load a class that isn't assignable\");\n } catch (RuntimeException re) {\n ass... | {
"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_475 | {
"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 testValidatePartitionedTopicNameSuccess() {\n String tenant = \"test-tenant\";\n String namespace = \"test-namespace\";\n String topic = Codec.encode(\"test-topic\");\n\n AdminResource resource = mockResource();\n resource.validatePartitionedTopicNa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AdminResource.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AdminResource.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "protected void validatePartitionedTopicName(String tenant, String namespace, String encodedTopic) {\n // first, it has to be a validate topic name\n validateTopicName(tenant, namespace, encodedTopic);\n // second, \"-partition-\" is not allowed\n if (encodedTopic.contains(TopicN... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_249 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentDeadLetterTopic() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"deadLetterTopic\", \"Different\");\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdat... | {
"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_31 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BatchMessageAckerDisabledTest.java",
"identifier": "BatchMessageAckerDisabledTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAckCumulative() {\n for (int i = 0; i < 10; i++) {\n assertTrue(BatchMessageAckerDisabled.INSTANCE.ackCumulative(i));\n }\n }",
"class_method_signature": "BatchMessageAckerDisabledTest.testAckCumulative()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "INSTANCE = new BatchMessageAckerDisabled()",
"modifier": "static final",
"original_string": "static final BatchMessageAckerDisabled INSTANCE = new BatchMessageAckerDisabled();",
"type": "BatchMessageAckerDisabled",
"var_name": "INSTANCE"
}
],
"f... | {
"body": "@Override\n public boolean ackCumulative(int batchIndex) {\n return true;\n }",
"class_method_signature": "BatchMessageAckerDisabled.ackCumulative(int batchIndex)",
"constructor": false,
"full_signature": "@Override public boolean ackCumulative(int batchIndex)",
"identifier": "ackCumul... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_398 | {
"fields": [],
"file": "pulsar-broker-common/src/test/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoaderTest.java",
"identifier": "PulsarConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConfigurationConverting() throws Exception {\n MockConfiguration mockConfiguration = new MockConfiguration();\n ServiceConfiguration serviceConfiguration = PulsarConfigurationLoader.convertFrom(mockConfiguration);\n\n // check whether converting correctly\n ... | {
"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 ServiceConfiguration convertFrom(PulsarConfiguration conf, boolean ignoreNonExistMember) throws RuntimeException {\n try {\n final ServiceConfiguration convertedConf = ServiceConfiguration.class.newInstance();\n Field[] confFields = conf.getClass().getDeclaredFiel... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_232 | {
"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 = \"Function Names differ\")\n public void testMergeDifferentName() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"name... | {
"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_377 | {
"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 testAuthenticateSignedTokenWithDifferentDomain() throws Exception {\n\n List<String> roles = new ArrayList<String>() {\n {\n add(\"test_role\");\n }\n };\n RoleToken token = new RoleToken.Builder(\"Z1\", \"invalid\", roles).pr... | {
"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_459 | {
"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 testRemoveOwnership() throws Exception {\n OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory, nsService);\n NamespaceName testNs = NamespaceName.get(\"pulsar/test/ns-7\");\n NamespaceBundle bundle = bundleFactory.getFullBundle(testNs);\n ... | {
"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 CompletableFuture<Void> removeOwnership(NamespaceBundle bundle) {\n CompletableFuture<Void> result = new CompletableFuture<>();\n String key = ServiceUnitZkUtils.path(bundle);\n localZkCache.getZooKeeper().delete(key, -1, (rc, path, ctx) -> {\n // Invalidate cache eve... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_66 | {
"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 testConsumerBuilderImplWhenPatternAutoDiscoveryPeriodPeriodIsNegative() {\n consumerBuilderImpl.patternAutoDiscoveryPeriod(-1, TimeUnit.MINUTES);\n }",
"class_method_signature": "ConsumerBuilderImplTest.testConsumerBuil... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private C... | {
"body": "@Override\n public ConsumerBuilder<T> patternAutoDiscoveryPeriod(int periodInMinutes) {\n checkArgument(periodInMinutes >= 0, \"periodInMinutes needs to be >= 0\");\n patternAutoDiscoveryPeriod(periodInMinutes, TimeUnit.MINUTES);\n return this;\n }",
"class_method_signature": "... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_89 | {
"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 testNotAllowNullDecodeWithInvalidContent() {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).withAlwaysAllowNull(false).build());\n jsonSchema.decode(new byte[0]);\... | {
"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_265 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java",
"identifier": "WindowConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSettingTumblingCountWindow() throws Exception {\n final Object[] args = new Object[]{-1, 0, 1, 2, 5, 10, null};\n\n for (Object arg : args) {\n Object arg0 = arg;\n try {\n\n Integer windowLengthCount = null;\n if ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_LAG_MS = 0",
"modifier": "public static final",
"original_string": "public static final long DEFAULT_MAX_LAG_MS = 0;",
"type": "long",
"var_name": "DEFAULT_MAX_LAG_MS"
},
{
"declarator": "DEFAULT_WATERMARK_EVENT_INTERVAL_MS = 1... | {
"body": "public static void validate(WindowConfig windowConfig) {\n if (windowConfig.getWindowLengthDurationMs() == null && windowConfig.getWindowLengthCount() == null) {\n throw new IllegalArgumentException(\"Window length is not specified\");\n }\n\n if (windowConfig.getWindowLengt... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_320 | {
"fields": [
{
"declarator": "mockSourceContext",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SourceContext mockSourceContext;",
"type": "SourceContext",
"var_name": "mockSourceContext"
},
{
"declarator": "mockMongoClient",
"modifier"... | {
"body": "@Test\n public void testOpen() throws Exception {\n source.open(map, mockSourceContext);\n }",
"class_method_signature": "MongoSourceTest.testOpen()",
"constructor": false,
"full_signature": "@Test public void testOpen()",
"identifier": "testOpen",
"invocations": [
"open"
],
... | {
"fields": [
{
"declarator": "clientProvider",
"modifier": "private final",
"original_string": "private final Supplier<MongoClient> clientProvider;",
"type": "Supplier<MongoClient>",
"var_name": "clientProvider"
},
{
"declarator": "mongoConfig",
"modifier": "priv... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n log.info(\"Open MongoDB Source\");\n\n mongoConfig = MongoConfig.load(config);\n mongoConfig.validate(false, false);\n\n if (clientProvider != null) {\n mongo... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_70 | {
"fields": [
{
"declarator": "FOO_PROPERTIES = new HashMap() {\n\n private static final long serialVersionUID = 58641844834472929L;\n\n {\n put(\"foo1\", \"foo-value1\");\n put(\"foo2\", \"foo-value2\");\n put(\"foo3\", \"foo-value3\");\n }\n\n }",
... | {
"body": "@Test\n public void testKeyValueSchemaInfoToString() throws JSONException {\n String havePrimitiveType = DefaultImplementation\n .convertKeyValueSchemaInfoDataToString(KeyValueSchemaInfo\n .decodeKeyValueSchemaInfo(Schema.KeyValue(Schema.AVRO(Foo.class), Sche... | {
"fields": [
{
"declarator": "SCHEMA_INFO_WRITER = new Schema<SchemaInfo>() {\n @Override\n public byte[] encode(SchemaInfo si) {\n return si.getSchema();\n }\n\n @Override\n public SchemaInfo getSchemaInfo() {\n return BytesSchema.BYTES.getSchemaInf... | {
"body": "public static KeyValue<SchemaInfo, SchemaInfo> decodeKeyValueSchemaInfo(SchemaInfo schemaInfo) {\n checkArgument(SchemaType.KEY_VALUE == schemaInfo.getType(),\n \"Not a KeyValue schema\");\n\n return KeyValue.decode(\n schemaInfo.getSchema(),\n (keyBytes, valu... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_273 | {
"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 testMergeDifferentClassName() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"className\", \"Different\");\n SinkConfig mergedConfig = SinkConfigUtils.validateUpdate(sinkConfig, newSinkConfig);\n asser... | {
"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_336 | {
"fields": [],
"file": "pulsar-io/common/src/test/java/org/apache/pulsar/io/common/IOConfigUtilsTest.java",
"identifier": "IOConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSinkLoadWithSecrets() {\n\n Map<String, Object> configMap = new HashMap<>();\n configMap.put(\"notSensitive\", \"foo\");\n TestConfig testConfig = IOConfigUtils.loadWithSecrets(configMap, TestConfig.class, new TestSinkContext());\n\n Assert.assertEqual... | {
"fields": [],
"file": "pulsar-io/common/src/main/java/org/apache/pulsar/io/common/IOConfigUtils.java",
"identifier": "IOConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "IOConfigUtils.loadWithSecrets(Map<String, Object> map, Class<T> clazz, SourceContext sourceContext)",
... | {
"body": "public static <T> T loadWithSecrets(Map<String, Object> map, Class<T> clazz, SourceContext sourceContext) {\n return loadWithSecrets(map, clazz, secretName -> sourceContext.getSecret(secretName));\n }",
"class_method_signature": "IOConfigUtils.loadWithSecrets(Map<String, Object> map, Class<T> c... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_418 | {
"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 testNoBrokers() {\n LoadData loadData = new LoadData();\n assertTrue(os.findBundlesForUnloading(loadData, conf).isEmpty());\n }",
"class_method_signature": "OverloadShedderTest.testNoBrokers()",
"constructor": false,
"full_signature": "@Test public void testNoB... | {
"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_27 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/RoundRobinPartitionMessageRouterImplTest.java",
"identifier": "RoundRobinPartitionMessageRouterImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChoosePartitionWithKey() {\n String key1 = \"key1\";\n String key2 = \"key2\";\n Message<?> msg1 = mock(Message.class);\n when(msg1.hasKey()).thenReturn(true);\n when(msg1.getKey()).thenReturn(key1);\n Message<?> msg2 = mock(Message.class... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "PARTITION_INDEX_UPDATER =\n At... | {
"body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata topicMetadata) {\n // If the message has a key, it supersedes the round robin routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), topicMetadata.numPartitions());\n }\n\... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_224 | {
"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 testValidateConfig() throws IOException {\n mockStatic(ConnectorUtils.class);\n defn = new ConnectorDefinition();\n defn.setSourceConfigClass(SourceConfigUtilsTest.TestSourceConfig.class.getName());\n PowerMockito.when(ConnectorUtils.getConnectorDefinition... | {
"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 void validateConnectorConfig(SourceConfig sourceConfig, ClassLoader classLoader) {\n try {\n ConnectorDefinition defn = ConnectorUtils.getConnectorDefinition(classLoader);\n if (defn.getSourceConfigClass() != null) {\n Class configClass = Class.forN... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_361 | {
"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 testGetTableMetadata(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n List<TopicName> allTopics = new LinkedList<>();\n allTopics.addAll(topicNames.stream().filter(top... | {
"fields": [
{
"declarator": "connectorId",
"modifier": "private final",
"original_string": "private final String connectorId;",
"type": "String",
"var_name": "connectorId"
},
{
"declarator": "pulsarAdmin",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) {\n ConnectorTableMetadata connectorTableMetadata;\n SchemaTableName schemaTableName = convertTableHandle(table).toSchemaTableName();\n connectorTableMetadata = getTableM... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_316 | {
"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 testNettyTcpConfigLoadWithYamlFileWhenInvalidPropertyIsSet() throws IOException {\n File yamlFile = getFile(\"nettySourceConfigWithInvalidProperty.yaml\");\n NettySourceConfig.load(yamlFile.getAbsolutePath());\n ... | {
"fields": [
{
"declarator": "serialVersionUID = -7116130435021510496L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7116130435021510496L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "typ... | {
"body": "public static NettySourceConfig load(Map<String, Object> map) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n return mapper.readValue(new ObjectMapper().writeValueAsString(map), NettySourceConfig.class);\n }",
"class_method_signature": "NettySourceConfig.load(Map<Strin... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_253 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentWindowConfig() {\n FunctionConfig functionConfig = createFunctionConfig();\n WindowConfig windowConfig = new WindowConfig();\n windowConfig.setSlidingIntervalCount(123);\n windowConfig.setSlidingIntervalDurationMs(123l);\n Function... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_480 | {
"fields": [
{
"declarator": "factory = getNamespaceBundleFactory()",
"modifier": "private final",
"original_string": "private final NamespaceBundleFactory factory = getNamespaceBundleFactory();",
"type": "NamespaceBundleFactory",
"var_name": "factory"
}
],
"file": "pulsar-b... | {
"body": "@Test\n public void testIncludes() throws Exception {\n TopicName topicName = TopicName.get(\"persistent://pulsar/use/ns1/topic-1\");\n Long hashKey = factory.getLongHashCode(topicName.toString());\n Long upper = Math.max(hashKey + 1, NamespaceBundles.FULL_UPPER_BOUND);\n Bou... | {
"fields": [
{
"declarator": "nsname",
"modifier": "private final",
"original_string": "private final NamespaceName nsname;",
"type": "NamespaceName",
"var_name": "nsname"
},
{
"declarator": "keyRange",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Override\n public boolean includes(TopicName topicName) {\n if (!this.nsname.equals(topicName.getNamespaceObject())) {\n return false;\n }\n return this.keyRange.contains(factory.getLongHashCode(topicName.toString()));\n }",
"class_method_signature": "NamespaceBundl... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_50 | {
"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 testConfigure() throws Exception {\n Map<String, String> params = new HashMap<>();\n params.put(\"type\", \"client_credentials\");\n params.put(\"privateKey\", \"data:base64,e30=\");\n params.put(\"issuerUrl\", \"http://localhost\");\n params.put(\"... | {
"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_195 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Bad config passed to TestBatchPushSource\")\n public void testPushWithoutRightSourceConfig() throws Exception {\n pushConfig.remove(\"foo\");\n pushConfig.put(\"something\", \"else\");\n batchSourceExec... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_3 | {
"fields": [
{
"declarator": "BROKER_URL = \"metadata.broker.list\"",
"modifier": "private static final",
"original_string": "private static final String BROKER_URL = \"metadata.broker.list\";",
"type": "String",
"var_name": "BROKER_URL"
},
{
"declarator": "PRODUCER_TY... | {
"body": "@Test\n public void testPulsarKafkaProducer() throws Exception {\n // https://kafka.apache.org/08/documentation.html#producerconfigs\n Properties properties = new Properties();\n properties.put(BROKER_URL, \"http://localhost:8080/\");\n properties.put(COMPRESSION_CODEC, \"gzi... | {
"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": "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public PulsarKafkaProducer(ProducerConfig config) {\n super((kafka.producer.Producer) null);\n partitioner = config.partitionerClass() != null\n ? newInstance(config.partitionerClass(), Partitioner.class, config.props())\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_204 | {
"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 testDefaultSerDe() throws PulsarClientException {\n\n PulsarSinkConfig pulsarConfig = getPulsarConfigs();\n // set type to void\n pulsarConfig.setTypeClassName(String.class.getName());\n PulsarSink pulsarSink = new PulsarSink(getPulsarClient(), pulsarConfi... | {
"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_438 | {
"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 testRecreateSameProducer() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Recreating a producer with the same id should succeed\n\n String producerName = \"my-producer\";\n\n ByteBuf createProducer1 = Commands.... | {
"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_592 | {
"fields": [
{
"declarator": "ml1",
"modifier": "",
"original_string": "ManagedLedgerImpl ml1;",
"type": "ManagedLedgerImpl",
"var_name": "ml1"
},
{
"declarator": "ml2",
"modifier": "",
"original_string": "ManagedLedgerImpl ml2;",
"type": "ManagedLedg... | {
"body": "@Test(timeOut = 5000)\n void entryCacheDisabledAsyncReadEntry() throws Exception {\n ReadHandle lh = EntryCacheTest.getLedgerHandle();\n\n ManagedLedgerFactoryConfig config = new ManagedLedgerFactoryConfig();\n config.setMaxCacheSize(0);\n ManagedLedgerFactoryImpl factory = n... | {
"fields": [
{
"declarator": "maxSize",
"modifier": "private final",
"original_string": "private final long maxSize;",
"type": "long",
"var_name": "maxSize"
},
{
"declarator": "evictionTriggerThreshold",
"modifier": "private final",
"original_string": "priv... | {
"body": "public EntryCache getEntryCache(ManagedLedgerImpl ml) {\n if (maxSize == 0) {\n // Cache is disabled\n return new EntryCacheDisabled(ml);\n }\n\n EntryCache newEntryCache = new EntryCacheImpl(this, ml, mlFactory.getConfig().isCopyEntriesInCache());\n EntryC... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_357 | {
"fields": [],
"file": "pulsar-io/kinesis/src/test/java/org/apache/pulsar/io/kinesis/KinesisSinkTest.java",
"identifier": "KinesisSinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCredentialProviderPlugin() throws Exception {\n KinesisSink sink = new KinesisSink();\n\n AWSCredentialsProvider credentialProvider = sink\n .createCredentialProviderWithPlugin(AwsCredentialProviderPluginImpl.class.getName(), \"{}\")\n ... | {
"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_212 | {
"fields": [
{
"declarator": "defn",
"modifier": "private",
"original_string": "private ConnectorDefinition defn;",
"type": "ConnectorDefinition",
"var_name": "defn"
}
],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.ja... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Function Names differ\")\n public void testMergeDifferentName() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"name\", \"Differ... | {
"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_11 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/ClientBuilderImplTest.java",
"identifier": "ClientBuilderImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testClientBuilderWithServiceUrlAndServiceUrlProviderNotSet() throws PulsarClientException {\n PulsarClient.builder().build();\n }",
"class_method_signature": "ClientBuilderImplTest.testClientBuilderWithServiceUrlAndServ... | {
"fields": [
{
"declarator": "conf",
"modifier": "",
"original_string": "ClientConfigurationData conf;",
"type": "ClientConfigurationData",
"var_name": "conf"
}
],
"file": "pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientBuilderImpl.java",
"identifier": "Cl... | {
"body": "@Override\n public PulsarClient build() throws PulsarClientException {\n if (StringUtils.isBlank(conf.getServiceUrl()) && conf.getServiceUrlProvider() == null) {\n throw new IllegalArgumentException(\"service URL or service URL provider needs to be specified on the ClientBuilder object... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_584 | {
"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 testGetSecondaryBrokers() throws Exception {\n List<String> secondaryBrokers = this.getDefaultPolicy().getSecondaryBrokers();\n assertEquals(secondaryBrokers.size(), 1);\n assertEquals(secondaryBrokers.get(0), \"prod1-broker.*.use.example.com\");\n }",
"clas... | {
"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 List<String> getSecondaryBrokers() {\n return this.secondary;\n }",
"class_method_signature": "NamespaceIsolationPolicyImpl.getSecondaryBrokers()",
"constructor": false,
"full_signature": "@Override public List<String> getSecondaryBrokers()",
"identifier": "getSecond... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_300 | {
"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 testNoRegionConfigured() throws Exception {\n OffloadPolicies conf = new OffloadPolicies();\n conf.setManagedLedgerOffloadDriver(\"s3\");\n conf.setS3ManagedLedgerOffloadBucket(BUCKET);\n\n try {\n BlobStoreManagedLedgerOffloader.create(conf, sc... | {
"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_245 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentSecrets() {\n FunctionConfig functionConfig = createFunctionConfig();\n Map<String, String> mySecrets = new HashMap<>();\n mySecrets.put(\"MyKey\", \"MyValue\");\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"secrets\"... | {
"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_496 | {
"fields": [],
"file": "pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/serialization/CsvSerializationSchemaTest.java",
"identifier": "CsvSerializationSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCsvSerializationSchemaWithEmptyRecord() throws IOException {\n Tuple3<Integer, String, String> employee = new Tuple3();\n CsvSerializationSchema schema = new CsvSerializationSchema();\n byte[] employeeBytes = schema.serialize(employee);\n String str = ... | {
"fields": [
{
"declarator": "serialVersionUID = -3379119592495232636L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3379119592495232636L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "STR... | {
"body": "@Override\n public byte[] serialize(T t) {\n StringWriter stringWriter;\n try {\n Object[] fieldsValues = new Object[t.getArity()];\n for (int index = 0; index < t.getArity(); index++) {\n fieldsValues[index] = (t.getField(index));\n }\n\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_479 | {
"fields": [
{
"declarator": "factory = getNamespaceBundleFactory()",
"modifier": "private final",
"original_string": "private final NamespaceBundleFactory factory = getNamespaceBundleFactory();",
"type": "NamespaceBundleFactory",
"var_name": "factory"
}
],
"file": "pulsar-b... | {
"body": "@Test\n public void testEquals() throws Exception {\n NamespaceBundle bundle = factory.getBundle(NamespaceName.get(\"pulsar/use/ns1\"),\n Range.range(0l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));\n NamespaceBundle bundle2 = factory.getBundle(NamespaceName.get(\"pulsar... | {
"fields": [
{
"declarator": "nsname",
"modifier": "private final",
"original_string": "private final NamespaceName nsname;",
"type": "NamespaceName",
"var_name": "nsname"
},
{
"declarator": "keyRange",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Override\n public boolean equals(Object other) {\n if (other instanceof NamespaceBundle) {\n NamespaceBundle obj = (NamespaceBundle) other;\n return Objects.equal(this.nsname, obj.nsname)\n && (Objects.equal(this.keyRange.lowerEndpoint(), obj.keyRange.low... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_183 | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private InstanceConfig config;",
"type": "InstanceConfig",
"var_name": "config"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private Logger logger;"... | {
"body": "@Test\n public void testDeleteStateStateEnabled() throws Exception {\n context.stateContext = mock(StateContextImpl.class);\n ByteBuffer buffer = ByteBuffer.wrap(\"test-value\".getBytes(UTF_8));\n context.deleteStateAsync(\"test-key\");\n verify(context.stateContext, times(1)... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private InstanceConfig config;",
"type": "InstanceConfig",
"var_name": "config"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private Logger logger;"... | {
"body": "@Override\n public CompletableFuture<Void> deleteStateAsync(String key) {\n ensureStateEnabled();\n return stateContext.delete(key);\n }",
"class_method_signature": "ContextImpl.deleteStateAsync(String key)",
"constructor": false,
"full_signature": "@Override public CompletableFut... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_46 | {
"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 testGetAuthMethodName() {\n assertEquals(this.auth.getAuthMethodName(), \"token\");\n }",
"class_method_signature": "AuthenticationOAuth2Test.testGetAuthMethodName()",
"constructor": false,
"full_signature": "@Test public void testGetAuthMethodName()",
"identifier":... | {
"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 String getAuthMethodName() {\n return AUTH_METHOD_NAME;\n }",
"class_method_signature": "AuthenticationOAuth2.getAuthMethodName()",
"constructor": false,
"full_signature": "@Override public String getAuthMethodName()",
"identifier": "getAuthMethodName",
"invocation... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_394 | {
"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 testListenerWithoutTLSPort() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setAdvertisedListeners(\" internal:pulsar://127.0.0.1:6660, internal:pulsar+ssl://127.0.0.1:6651\");\n config.... | {
"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_402 | {
"fields": [],
"file": "pulsar-broker-common/src/test/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoaderTest.java",
"identifier": "PulsarConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInComplete() throws IllegalAccessException {\n\n try {\n isComplete(this.new TestInCompleteObjectRequired());\n fail(\"Should fail w/ illegal argument exception\");\n } catch (IllegalArgumentException iae) {\n // OK, expected\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PulsarConfigurationLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarConfigurationLoader.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "public static boolean isComplete(Object obj) throws IllegalArgumentException {\n checkNotNull(obj);\n Field[] fields = obj.getClass().getDeclaredFields();\n StringBuilder error = new StringBuilder();\n for (Field field : fields) {\n if (field.isAnnotationPresent(Field... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_547 | {
"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 testFirstRange() {\n ConcurrentOpenLongPairRangeSet<LongPair> set = new ConcurrentOpenLongPairRangeSet<>(consumer);\n assertNull(set.firstRange());\n Range<LongPair> range = Range.openClosed(new LongPair(0, 97), new LongPair(0, 99));\n set.add(range);\n ... | {
"fields": [
{
"declarator": "rangeBitSetMap = new ConcurrentSkipListMap<>()",
"modifier": "protected final",
"original_string": "protected final NavigableMap<Long, BitSet> rangeBitSetMap = new ConcurrentSkipListMap<>();",
"type": "NavigableMap<Long, BitSet>",
"var_name": "rangeBitS... | {
"body": "@Override\n public Range<T> firstRange() {\n if (rangeBitSetMap.isEmpty()) {\n return null;\n }\n Entry<Long, BitSet> firstSet = rangeBitSetMap.firstEntry();\n int lower = firstSet.getValue().nextSetBit(0);\n int upper = Math.max(lower, firstSet.getValue().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_117 | {
"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 testAppendWithLayout() throws Exception {\n final Appender appender = ctx.getConfiguration().getAppender(\"PulsarAppenderWithLayout\");\n appender.append(createLogEvent());\n final Message<byte[]> item;\n synchronized (history) {\n assertEquals(... | {
"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"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.