id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
17651735_4 | {
"fields": [
{
"declarator": "tc",
"modifier": "private",
"original_string": "private ChineseTrans tc;",
"type": "ChineseTrans",
"var_name": "tc"
}
],
"file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/ChineseTransTest.java",
"identifier": "ChineseTransTest",
"interfaces":... | {
"body": "@Test\n\tpublic void testToFullWidth() {\n\t\tString str;\n\t\tstr = \"http://news.bbc.co.uk/1/hi/programmes/panorama/live_forums/2124808.stm\";\n\t\tstr = tc.toFullWidth(str);\n\t\tSystem.out.println(str);\n\t}",
"class_method_signature": "ChineseTransTest.testToFullWidth()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "s2l = null",
"modifier": "",
"original_string": "TCharCharHashMap s2l = null;",
"type": "TCharCharHashMap",
"var_name": "s2l"
},
{
"declarator": "l2s = null",
"modifier": "",
"original_string": "TCharCharHashMap l2s = null;",
... | {
"body": "public static String toFullWidth(String input) {\n\t\tchar[] c = input.toCharArray();\n\t\tfor (int i = 0; i< c.length; i++) {\n\t\t\tc[i]= toFullWidth(c[i]);\n\t\t}\n\t\treturn new String(c);\n\t}",
"class_method_signature": "ChineseTrans.toFullWidth(String input)",
"constructor": false,
"full_signa... | {
"created": null,
"fork": null,
"fork_count": 716,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17651735,
"size": 2754,
"stargazer_count": 2336,
"stars": null,
"updates": null,
"url": "https://github.com/FudanNLP/fnlp"
} |
17651735_19 | {
"fields": [],
"file": "fnlp-core/src/test/java/org/fnlp/util/MyArraysTest.java",
"identifier": "MyArraysTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testentropy() {\n\t\tint[] w;\n\t\tfloat[] ww;\n\t\tfloat e;\n\t\tw= new int[]{ 1, 2, 3, 4, 0, 0, 0 };\t\t\n\t\te = MyArrays.entropy(w);\t\t\n\t\tSystem.out.print(e + \" \");\n\t\t\n\t\tww= new float[]{ 1, 0, 0, 0, 0, 0, 0 };\t\t\n\t\te = MyArrays.entropy(ww);\t\t\n\t\tSystem.out.print... | {
"fields": [],
"file": "fnlp-core/src/main/java/org/fnlp/util/MyArrays.java",
"identifier": "MyArrays",
"interfaces": "",
"methods": [
{
"class_method_signature": "MyArrays.addBest(float[] scores, Object[] predList, float score, Object pred)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static float entropy(float[] c) {\n\t\t\n\t\tfloat e = 0.0f;\n\t\tfor(int i=0;i<c.length;i++){\n\t\t\tif(c[i]!=0.0&&c[i]!=1){\n\t\t\t\te -= c[i]*Math.log(c[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn e;\n\t}",
"class_method_signature": "MyArrays.entropy(float[] c)",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 716,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17651735,
"size": 2754,
"stargazer_count": 2336,
"stars": null,
"updates": null,
"url": "https://github.com/FudanNLP/fnlp"
} |
17651735_8 | {
"fields": [
{
"declarator": "tag",
"modifier": "static",
"original_string": "static CWSTagger tag;",
"type": "CWSTagger",
"var_name": "tag"
}
],
"file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/tag/CWSTaggerTest.java",
"identifier": "CWSTaggerTest",
"interfaces": "",
... | {
"body": "@Test\n\tpublic void testTagString2() {\n\t\tString str = \"中文分词指的是将一个汉字序列切分成一个一个单独的词。分词就是将连续的字序列按照一定的规范重新组合成词序列的过程。我们知道,在英文的行文中,单词之间是以空格作为自然分界符的,而中文只是字、句和段能通过明显的分界符来简单划界,唯独词没有一个形式上的分界符,虽然英文也同样存在短语的划分问题,不过在词这一层上,中文比之英文要复杂的多、困难的多。\";\n\t\tString s = tag.tag(str);\n\t\tSystem.out.println(s);\n\t\tassertTrue(... | {
"fields": [
{
"declarator": "dictPipe = null",
"modifier": "private",
"original_string": "private DictLabel dictPipe = null;",
"type": "DictLabel",
"var_name": "dictPipe"
},
{
"declarator": "oldfeaturePipe=null",
"modifier": "private",
"original_string": "... | {
"body": "@Override\n\tpublic String tag(String src) {\n\t\tif(src==null||src.length()==0)\n\t\t\treturn src;\n\t\tString[] sents = Sentenizer.split(src);\n\t\tString tag = \"\";\n\t\ttry {\n\t\t\tfor (int i = 0; i < sents.length; i++) {\n\t\t\t\tInstance inst = new Instance(sents[i]);\n\t\t\t\tString[] preds = _tag... | {
"created": null,
"fork": null,
"fork_count": 716,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17651735,
"size": 2754,
"stargazer_count": 2336,
"stars": null,
"updates": null,
"url": "https://github.com/FudanNLP/fnlp"
} |
17651735_15 | {
"fields": [],
"file": "fnlp-core/src/test/java/org/fnlp/nlp/pipe/seq/String2SequenceTest.java",
"identifier": "String2SequenceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGenSequence() {\n\t\tString input = \"我000们ss001 在 这里 哈哈ssss哈s。\";\n\t\tString[][] s = String2Sequence.genSequence(input);\n\t\tSystem.out.println(MyStrings.toString(s, \",\", \"\\n\"));\n\t}",
"class_method_signature": "String2SequenceTest.testGenSequence()",
"constructor": fa... | {
"fields": [
{
"declarator": "isEnFilter = true",
"modifier": "",
"original_string": "boolean isEnFilter = true;",
"type": "boolean",
"var_name": "isEnFilter"
},
{
"declarator": "serialVersionUID = 5699154494725645936L",
"modifier": "private static final",
... | {
"body": "public static String[][] genSequence(String sent){\n\n\t\tCharType[] tags = Chars.getType(sent);\n\t\tint len = sent.length();\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\tArrayList<String> types = new ArrayList<String>();\n\t\tint begin =0;\n\t\tfor(int j=0; j<len; j++) {\t\t\t\n\t\t\tif(j... | {
"created": null,
"fork": null,
"fork_count": 716,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17651735,
"size": 2754,
"stargazer_count": 2336,
"stars": null,
"updates": null,
"url": "https://github.com/FudanNLP/fnlp"
} |
9797598_0 | {
"fields": [
{
"declarator": "CAS_SERVICE = \"https://mfa.cas.edu\"",
"modifier": "private static final",
"original_string": "private static final String CAS_SERVICE = \"https://mfa.cas.edu\";",
"type": "String",
"var_name": "CAS_SERVICE"
},
{
"declarator": "CAS_AUTHN_... | {
"body": "@Test\n public void testResolveWithoutAnyServiceMfaAttributes() throws Exception {\n final WebApplicationService was = getTargetService();\n final Authentication auth = getAuthentication(true);\n\n final RegisteredService rswa = TestUtils.getRegisteredService(\"test1\");\n fi... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(this.getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "m... | {
"body": "public List<MultiFactorAuthenticationRequestContext> resolve(@NotNull final Authentication authentication,\n @NotNull final WebApplicationService targetService) {\n\n String authenticationMethodAttributeName = null;\n final List<... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9797598,
"size": 1423,
"stargazer_count": 23,
"stars": null,
"updates": null,
"url": "https://github.com/Unicon/cas-mfa"
} |
9797598_1 | {
"fields": [
{
"declarator": "CAS_SERVICE = \"https://mfa.cas.edu\"",
"modifier": "private static final",
"original_string": "private static final String CAS_SERVICE = \"https://mfa.cas.edu\";",
"type": "String",
"var_name": "CAS_SERVICE"
},
{
"declarator": "CAS_AUTHN_... | {
"body": "@Test\n public void testResolveWithoutIncompleteServiceMfaAttributes() throws Exception {\n final WebApplicationService was = getTargetService();\n final Authentication auth = getAuthentication(true);\n\n final RegisteredService rswa = TestUtils.getRegisteredService(\"test1\");\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(this.getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "m... | {
"body": "public List<MultiFactorAuthenticationRequestContext> resolve(@NotNull final Authentication authentication,\n @NotNull final WebApplicationService targetService) {\n\n String authenticationMethodAttributeName = null;\n final List<... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9797598,
"size": 1423,
"stargazer_count": 23,
"stars": null,
"updates": null,
"url": "https://github.com/Unicon/cas-mfa"
} |
9797598_2 | {
"fields": [
{
"declarator": "CAS_SERVICE = \"https://mfa.cas.edu\"",
"modifier": "private static final",
"original_string": "private static final String CAS_SERVICE = \"https://mfa.cas.edu\";",
"type": "String",
"var_name": "CAS_SERVICE"
},
{
"declarator": "CAS_AUTHN_... | {
"body": "@Test\n public void testResolveServiceWithMfaAttributesUserInRole() throws Exception {\n final WebApplicationService was = getTargetService();\n final Authentication auth = getAuthentication(true);\n\n\n final RegisteredService rswa = TestUtils.getRegisteredService(\"test1\");\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(this.getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "m... | {
"body": "public List<MultiFactorAuthenticationRequestContext> resolve(@NotNull final Authentication authentication,\n @NotNull final WebApplicationService targetService) {\n\n String authenticationMethodAttributeName = null;\n final List<... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9797598,
"size": 1423,
"stargazer_count": 23,
"stars": null,
"updates": null,
"url": "https://github.com/Unicon/cas-mfa"
} |
9797598_3 | {
"fields": [
{
"declarator": "CAS_SERVICE = \"https://mfa.cas.edu\"",
"modifier": "private static final",
"original_string": "private static final String CAS_SERVICE = \"https://mfa.cas.edu\";",
"type": "String",
"var_name": "CAS_SERVICE"
},
{
"declarator": "CAS_AUTHN_... | {
"body": "@Test\n public void testResolveServiceWithOnlyAuthnMethodAttribute() throws Exception {\n final WebApplicationService was = getTargetService();\n final Authentication auth = getAuthentication(true);\n\n final RegisteredService rswa = TestUtils.getRegisteredService(\"test1\");\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(this.getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "m... | {
"body": "public List<MultiFactorAuthenticationRequestContext> resolve(@NotNull final Authentication authentication,\n @NotNull final WebApplicationService targetService) {\n\n String authenticationMethodAttributeName = null;\n final List<... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9797598,
"size": 1423,
"stargazer_count": 23,
"stars": null,
"updates": null,
"url": "https://github.com/Unicon/cas-mfa"
} |
123788136_4 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testCountNewLines() {\n assertEquals(3, countOccurrence(\"\\nHello,\\nWorld!\\n\", NEW_LINE));\n assertEquals(2, countOccurrence(\"Hello, World\\n\\n\", NEW_LINE));\n }",
"class_method_signature": "UtilTest.testCountNewLines()",
"constructor": false,
"full_signature": "@Test ... | {
"fields": [
{
"declarator": "NEW_LINE = \"\\r\\n|\\r|\\n\"",
"modifier": "static final",
"original_string": "static final String NEW_LINE = \"\\r\\n|\\r|\\n\";",
"type": "String",
"var_name": "NEW_LINE"
}
],
"file": "rope/src/main/java/com/github/utsavoza/rope/Util.java",
... | {
"body": "static int countOccurrence(String s, String pattern) {\n Matcher matcher = Pattern.compile(pattern).matcher(s);\n int newLine = 0;\n while (matcher.find()) {\n newLine++;\n }\n return newLine;\n }",
"class_method_signature": "Util.countOccurrence(String s, String pattern)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_14 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testSize() {\n assertEquals(40, Interval.ofClosedOpen(2, 42).size());\n assertEquals(0, Interval.ofClosedOpen(1, 0).size());\n }",
"class_method_signature": "IntervalTest.testSize()",
"constructor": false,
"full_signature": "@Test public void testSize()",
"identifier": "tes... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public int size() {\n return this.end() - this.start();\n }",
"class_method_signature": "Interval.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [
"end",
"start"
],
"modifiers": "public",
"parameters": "()",
"return":... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_8 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testIsAfter() {\n Interval iv = Interval.ofOpenOpen(2, 42);\n assertTrue(iv.isAfter(1));\n assertTrue(iv.isAfter(2));\n assertFalse(iv.isAfter(3));\n assertFalse(iv.isAfter(41));\n assertFalse(iv.isAfter(42));\n assertFalse(iv.isAfter(43));\n\n iv = Interval.ofClos... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public boolean isAfter(int point) {\n int value = point * 2;\n return this.start > value;\n }",
"class_method_signature": "Interval.isAfter(int point)",
"constructor": false,
"full_signature": "public boolean isAfter(int point)",
"identifier": "isAfter",
"invocations": [],
"modifiers": "... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_18 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/RopeTest.java",
"identifier": "RopeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testSlice() {\n Rope a = Rope.from(\"hello world\");\n Rope b = a.slice(1, 9);\n assertEquals(b.toString(), \"ello wo\");\n assertNotEquals(a, b);\n\n Rope readme = Rope.from(text);\n Rope title = readme.slice(0, 4);\n assertEquals(title.toString(), \"Rope\");\n as... | {
"fields": [
{
"declarator": "root",
"modifier": "private",
"original_string": "private Node root;",
"type": "Node",
"var_name": "root"
},
{
"declarator": "start",
"modifier": "private",
"original_string": "private int start;",
"type": "int",
"v... | {
"body": "public Rope slice(int start, int end) {\n if (start < this.start || end > this.start + this.length) {\n throw new IllegalArgumentException(\n \"[\" + start + \", \" + end + \") interval is out of bounds for current rope\");\n }\n Node root = this.root;\n start += this.start;\n ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_19 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/RopeTest.java",
"identifier": "RopeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testEquals() {\n Rope a = Rope.from(\"hello\");\n Rope b = Rope.from(\"world\");\n Rope c = Rope.from(\"hello\");\n assertNotEquals(a, b);\n assertEquals(a, c);\n }",
"class_method_signature": "RopeTest.testEquals()",
"constructor": false,
"full_signature": "@Test pu... | {
"fields": [
{
"declarator": "root",
"modifier": "private",
"original_string": "private Node root;",
"type": "Node",
"var_name": "root"
},
{
"declarator": "start",
"modifier": "private",
"original_string": "private int start;",
"type": "int",
"v... | {
"body": "@Override public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (!(obj instanceof Rope)) {\n return false;\n }\n Rope otherRope = (Rope) obj;\n return this.length == otherRope.length\n && this.start == otherRope.start\n && this.root.equal... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_9 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testTranslate() {\n Interval iv = Interval.ofOpenOpen(2, 42);\n assertEquals(Interval.ofOpenOpen(5, 45), iv.translate(3));\n assertEquals(Interval.ofOpenOpen(1, 41), iv.translateNegative(1));\n }",
"class_method_signature": "IntervalTest.testTranslate()",
"constructor": fals... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public Interval translate(int amount) {\n int start = this.start() + amount;\n int end = this.end() + amount;\n return new Interval(start, this.isStartClosed(), end, this.isEndClosed());\n }",
"class_method_signature": "Interval.translate(int amount)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_15 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testUnion() {\n assertEquals(Interval.ofClosedClosed(1, 9),\n Interval.ofClosedOpen(1, 3).union(Interval.ofOpenClosed(7, 9)));\n }",
"class_method_signature": "IntervalTest.testUnion()",
"constructor": false,
"full_signature": "@Test public void testUnion()",
"identifie... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public Interval union(Interval other) {\n if (this.isEmpty()) return other;\n if (other.isEmpty()) return this;\n int start = Math.min(this.start(), other.start());\n int end = Math.max(this.end(), other.end());\n int actualStart = Math.min(this.start, other.start);\n int actualEnd = Math... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_5 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testIsCharBoundary() {\n String s = \"Löwe 老虎 Léopard\";\n assertTrue(isCharBoundary(s, 0));\n assertTrue(isCharBoundary(s, 6));\n assertTrue(isCharBoundary(s, s.length()));\n // second byte of ö\n assertFalse(isCharBoundary(s, 2));\n // third byte of 老\n assertFal... | {
"fields": [
{
"declarator": "NEW_LINE = \"\\r\\n|\\r|\\n\"",
"modifier": "static final",
"original_string": "static final String NEW_LINE = \"\\r\\n|\\r|\\n\";",
"type": "String",
"var_name": "NEW_LINE"
}
],
"file": "rope/src/main/java/com/github/utsavoza/rope/Util.java",
... | {
"body": "static boolean isCharBoundary(String s, int index) {\n return index == 0 || index == s.length() || s.getBytes()[index] >= -0x40;\n }",
"class_method_signature": "Util.isCharBoundary(String s, int index)",
"constructor": false,
"full_signature": "static boolean isCharBoundary(String s, int index)"... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_2 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/NodeTest.java",
"identifier": "NodeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testMergeNodes() {\n Node readme = Node.fromString(text);\n Node first = Node.fromString(text.substring(0, MAX_LEAF));\n Node second = Node.fromString(text.substring(MAX_LEAF, 2 * MAX_LEAF));\n Node third = Node.fromString(text.substring(2 * MAX_LEAF));\n Node parent = Node... | {
"fields": [
{
"declarator": "MIN_LEAF = 511",
"modifier": "static final",
"original_string": "static final int MIN_LEAF = 511;",
"type": "int",
"var_name": "MIN_LEAF"
},
{
"declarator": "MAX_LEAF = 1024",
"modifier": "static final",
"original_string": "sta... | {
"body": "static Node mergeNodes(List<Node> children1, List<Node> children2) {\n int totalChildren = children1.size() + children2.size();\n List<Node> children =\n Stream.concat(children1.stream(), children2.stream()).collect(Collectors.toList());\n if (totalChildren <= MAX_CHILDREN) {\n return ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_12 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testPrefix() {\n assertEquals(Interval.ofOpenOpen(1, 2),\n Interval.ofOpenOpen(1, 4).prefix(Interval.ofClosedClosed(2, 3)));\n }",
"class_method_signature": "IntervalTest.testPrefix()",
"constructor": false,
"full_signature": "@Test public void testPrefix()",
"identifie... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public Interval prefix(Interval other) {\n int start = Math.min(this.start(), other.start());\n int end = Math.min(this.end(), other.start());\n int actualStart = Math.min(this.start, other.start);\n int actualEnd = Math.min(this.end, other.start);\n return new Interval(start, (actualStart &... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_13 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testSuffix() {\n assertEquals(Interval.ofOpenOpen(3, 4),\n Interval.ofOpenOpen(1, 4).suffix(Interval.ofClosedClosed(2, 3)));\n }",
"class_method_signature": "IntervalTest.testSuffix()",
"constructor": false,
"full_signature": "@Test public void testSuffix()",
"identifie... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public Interval suffix(Interval other) {\n int start = Math.max(this.start(), other.end());\n int end = Math.max(this.end(), other.end());\n int actualStart = Math.max(this.start, other.end);\n int actualEnd = Math.max(this.end, other.end);\n return new Interval(start, (actualStart & 1) == 0... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_3 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/NodeTest.java",
"identifier": "NodeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testConcat() {\n Node hello = Node.fromString(\"hello\");\n Node world = Node.fromString(\" world\");\n Node helloWorld = Node.concat(hello, world);\n assertEquals(helloWorld.getString(), \"hello world\");\n helloWorld = hello.concat(world);\n assertEquals(helloWorld.get... | {
"fields": [
{
"declarator": "MIN_LEAF = 511",
"modifier": "static final",
"original_string": "static final int MIN_LEAF = 511;",
"type": "int",
"var_name": "MIN_LEAF"
},
{
"declarator": "MAX_LEAF = 1024",
"modifier": "static final",
"original_string": "sta... | {
"body": "static Node concat(Node rope1, Node rope2) {\n int rope1Height = rope1.getHeight();\n int rope2Height = rope2.getHeight();\n\n switch (compare(rope1Height, rope2Height)) {\n case LESS: {\n List<Node> rope2Children = rope2.getChildren();\n if (rope1Height == rope2Height - 1 && ro... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_10 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testIsEmpty() {\n assertTrue(Interval.ofOpenOpen(0, 0).isEmpty());\n assertFalse(Interval.ofClosedClosed(0, 0).isEmpty());\n assertFalse(Interval.ofClosedOpen(0, 1).isEmpty());\n assertTrue(Interval.ofOpenClosed(1, 0).isEmpty());\n }",
"class_method_signature": "IntervalTes... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public boolean isEmpty() {\n return this.start >= this.end;\n }",
"class_method_signature": "Interval.isEmpty()",
"constructor": false,
"full_signature": "public boolean isEmpty()",
"identifier": "isEmpty",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "boolean... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_0 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/NodeTest.java",
"identifier": "NodeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testEquals() {\n Node a = Node.fromString(\"hello\");\n Node b = Node.fromString(\"world\");\n Node c = Node.fromString(\"world\");\n assertNotEquals(a, b);\n assertEquals(b, c);\n\n Node d = Node.fromPieces(Arrays.asList(a, b));\n assertNotEquals(a, d);\n\n Node e... | {
"fields": [
{
"declarator": "MIN_LEAF = 511",
"modifier": "static final",
"original_string": "static final int MIN_LEAF = 511;",
"type": "int",
"var_name": "MIN_LEAF"
},
{
"declarator": "MAX_LEAF = 1024",
"modifier": "static final",
"original_string": "sta... | {
"body": "@Override public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Node)) {\n return false;\n }\n Node otherNode = (Node) o;\n return this.nodeBody.equals(otherNode.nodeBody);\n }",
"class_method_signature": "Node.equals(Object o)",
"cons... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_1 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/NodeTest.java",
"identifier": "NodeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testMergeLeaves() {\n Node hello = Node.fromString(\"hello\");\n Node world = Node.fromString(\"world\");\n Node mergedLeaves = Node.mergeLeaves(hello, world);\n Node helloWorld = Node.fromString(\"helloworld\");\n assertEquals(mergedLeaves, helloWorld);\n assertNotEqual... | {
"fields": [
{
"declarator": "MIN_LEAF = 511",
"modifier": "static final",
"original_string": "static final int MIN_LEAF = 511;",
"type": "int",
"var_name": "MIN_LEAF"
},
{
"declarator": "MAX_LEAF = 1024",
"modifier": "static final",
"original_string": "sta... | {
"body": "static Node mergeLeaves(Node rope1, Node rope2) {\n if (!rope1.isLeaf() || !rope2.isLeaf()) {\n throw new IllegalArgumentException(\"mergeLeaves() called with non-leaf node\");\n }\n if (rope1.getLength() >= MIN_LEAF && rope2.getLength() >= MIN_LEAF) {\n return Node.fromPieces(Arrays.asL... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_11 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testIntersect() {\n assertEquals(Interval.ofClosedOpen(2, 3),\n Interval.ofOpenOpen(1, 3).intersect(Interval.ofClosedClosed(2, 4)));\n assertTrue(Interval.ofClosedOpen(1, 2).intersect(Interval.ofClosedClosed(2, 43)).isEmpty());\n }",
"class_method_signature": "IntervalTest... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public Interval intersect(Interval other) {\n int start = Math.max(this.start(), other.start());\n int end = Math.min(this.end(), other.end());\n int actualStart = Math.max(this.start, other.start);\n int actualEnd = Math.min(this.end, other.end);\n return new Interval(start, (actualStart & ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_16 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/RopeTest.java",
"identifier": "RopeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testConcat() {\n Rope a = Rope.from(\"hello\");\n Rope b = Rope.from(\" world\");\n Rope c = a.concat(b);\n assertEquals(c.toString(), \"hello world\");\n assertEquals(a.toString(), \"hello\");\n assertEquals(b.toString(), \" world\");\n\n Rope license = Rope.from(tex... | {
"fields": [
{
"declarator": "root",
"modifier": "private",
"original_string": "private Node root;",
"type": "Node",
"var_name": "root"
},
{
"declarator": "start",
"modifier": "private",
"original_string": "private int start;",
"type": "int",
"v... | {
"body": "public Rope concat(Rope anotherRope) {\n if (anotherRope == null) {\n // should this be handled silently?\n throw new IllegalArgumentException(\"Attempting to concat this rope with null\");\n }\n Node newRoot = new Node(this.root.getNodeBody());\n return Rope.fromNode(newRoot.concat(a... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_6 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testContains() {\n Interval iv = Interval.ofOpenOpen(2, 42);\n assertFalse(iv.contains(1));\n assertFalse(iv.contains(2));\n assertTrue(iv.contains(3));\n assertTrue(iv.contains(41));\n assertFalse(iv.contains(42));\n assertFalse(iv.contains(43));\n\n iv = Interval... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public boolean contains(int point) {\n int value = point * 2;\n return this.start <= value && value < this.end;\n }",
"class_method_signature": "Interval.contains(int point)",
"constructor": false,
"full_signature": "public boolean contains(int point)",
"identifier": "contains",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_20 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/NodeBodyTest.java",
"identifier": "NodeBodyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testEquals() {\n String helloStr = \"hello\";\n NodeBody hello = new NodeBody.Builder()\n .height(0)\n .length(helloStr.length())\n .newlineCount(countOccurrence(helloStr, NEW_LINE))\n .val(new NodeBody.Leaf(helloStr))\n .build();\n\n String wor... | {
"fields": [
{
"declarator": "height",
"modifier": "private",
"original_string": "private int height;",
"type": "int",
"var_name": "height"
},
{
"declarator": "length",
"modifier": "private",
"original_string": "private int length;",
"type": "int",
... | {
"body": "@Override public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof NodeBody)) {\n return false;\n }\n NodeBody otherNodeBody = (NodeBody) o;\n return otherNodeBody.height == this.height\n && otherNodeBody.length == this.length\n ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_7 | {
"fields": [],
"file": "rope/src/test/java/com/github/utsavoza/rope/IntervalTest.java",
"identifier": "IntervalTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testIsBefore() {\n Interval iv = Interval.ofOpenOpen(2, 42);\n assertFalse(iv.isBefore(1));\n assertFalse(iv.isBefore(2));\n assertFalse(iv.isBefore(3));\n assertFalse(iv.isBefore(41));\n assertTrue(iv.isBefore(42));\n assertTrue(iv.isBefore(43));\n\n iv = Interval... | {
"fields": [
{
"declarator": "start",
"modifier": "private final",
"original_string": "private final int start;",
"type": "int",
"var_name": "start"
},
{
"declarator": "end",
"modifier": "private final",
"original_string": "private final int end;",
"t... | {
"body": "public boolean isBefore(int point) {\n int value = point * 2;\n return this.end <= value;\n }",
"class_method_signature": "Interval.isBefore(int point)",
"constructor": false,
"full_signature": "public boolean isBefore(int point)",
"identifier": "isBefore",
"invocations": [],
"modifiers"... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
123788136_17 | {
"fields": [
{
"declarator": "text",
"modifier": "private",
"original_string": "private String text;",
"type": "String",
"var_name": "text"
}
],
"file": "rope/src/test/java/com/github/utsavoza/rope/RopeTest.java",
"identifier": "RopeTest",
"interfaces": "",
"superclass... | {
"body": "@Test public void testReplace() {\n Rope a = Rope.from(\"hello world\");\n Rope b = a.replace(1, 9, \"era\");\n assertEquals(b.toString(), \"herald\");\n assertEquals(a.toString(), \"hello world\");\n assertNotEquals(a, b);\n\n Rope readme = Rope.from(text);\n Rope newLicense = readme.... | {
"fields": [
{
"declarator": "root",
"modifier": "private",
"original_string": "private Node root;",
"type": "Node",
"var_name": "root"
},
{
"declarator": "start",
"modifier": "private",
"original_string": "private int start;",
"type": "int",
"v... | {
"body": "public Rope replace(int start, int end, String newString) {\n if (start < this.start || end > this.start + this.length) {\n throw new IllegalArgumentException(\n \"[\" + start + \", \" + end + \") interval is out of bounds for current rope\");\n }\n // is a trivial replace operation ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 123788136,
"size": 849,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/utsavoza/rope"
} |
62117812_223 | {
"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 testMergeDifferentBatchSourceConfig() {\n SourceConfig sourceConfig = createSourceConfigWithBatch();\n BatchSourceConfig batchSourceConfig = createBatchSourceConfig();\n Map<String, Object> newConfig = new HashMap<>();\n newConfig.put(\"something\", \"diff... | {
"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_389 | {
"fields": [
{
"declarator": "SUBJECT = \"my-test-subject\"",
"modifier": "private static final",
"original_string": "private static final String SUBJECT = \"my-test-subject\";",
"type": "String",
"var_name": "SUBJECT"
}
],
"file": "pulsar-broker-common/src/test/java/org/apa... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testValidationWhenPublicKeyAlgIsInvalid() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_PUBLIC_ALG,\n \"invalid\");\n\n... | {
"fields": [
{
"declarator": "HTTP_HEADER_NAME = \"Authorization\"",
"modifier": "final static",
"original_string": "final static String HTTP_HEADER_NAME = \"Authorization\";",
"type": "String",
"var_name": "HTTP_HEADER_NAME"
},
{
"declarator": "HTTP_HEADER_VALUE_PREFI... | {
"body": "@Override\n public void initialize(ServiceConfiguration config) throws IOException, IllegalArgumentException {\n // we need to fetch the algorithm before we fetch the key\n this.publicKeyAlg = getPublicKeyAlgType(config);\n this.validationKey = getValidationKey(config);\n thi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_366 | {
"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 testListTable(String delimiter) {\n updateRewriteNamespaceDelimiterIfNeeded(delimiter);\n assertTrue(this.pulsarMetadata.listTables(mock(ConnectorSession.class), Optional.empty()).isEmpty());\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 List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName) {\n ImmutableList.Builder<SchemaTableName> builder = ImmutableList.builder();\n\n if (schemaName.isPresent()) {\n String schemaNameOrNull = schemaName.get();\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_20 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test\n public void testProducerBuilderImpl() throws PulsarClientException {\n Map<String, String> properties = new HashMap<>();\n properties.put(\"Test-Key2\", \"Test-Value2\");\n\n producerBuilderImpl = new ProducerBuilderImpl(client, Schema.BYTES);\n Producer producer = pr... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private P... | {
"body": "@VisibleForTesting\n public ProducerBuilderImpl(PulsarClientImpl client, Schema<T> schema) {\n this(client, new ProducerConfigurationData(), schema);\n }",
"class_method_signature": "ProducerBuilderImpl.ProducerBuilderImpl(PulsarClientImpl client, Schema<T> schema)",
"constructor": true,
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_274 | {
"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 = \"Input Topics cannot be altered\")\n public void testMergeDifferentInputs() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"topicsPattern\", ... | {
"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_331 | {
"fields": [],
"file": "pulsar-io/influxdb/src/test/java/org/apache/pulsar/io/influxdb/v1/InfluxDBSinkConfigTest.java",
"identifier": "InfluxDBSinkConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public final void loadFromYamlFileTest() throws IOException {\n File yamlFile = getFile(\"sinkConfig-v1.yaml\");\n String path = yamlFile.getAbsolutePath();\n InfluxDBSinkConfig config = InfluxDBSinkConfig.load(path);\n assertNotNull(config);\n assertEquals(\"h... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "influxdbUrl",
"modifier": "@FieldDo... | {
"body": "public static InfluxDBSinkConfig load(String yamlFile) throws IOException {\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n return mapper.readValue(new File(yamlFile), InfluxDBSinkConfig.class);\n }",
"class_method_signature": "InfluxDBSinkConfig.load(String yamlFile)",
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_448 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java",
"identifier": "BookkeeperSchemaStorageTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBkException() {\n Exception ex = bkException(\"test\", BKException.Code.ReadException, 1, -1);\n assertEquals(\"Error while reading ledger - ledger=1 - operation=test\", ex.getMessage());\n ex = bkException(\"test\", BKException.Code.ReadException, 1, 0);\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BookkeeperSchemaStorage.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BookkeeperSchemaStorage.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static Exception bkException(String operation, int rc, long ledgerId, long entryId) {\n String message = org.apache.bookkeeper.client.api.BKException.getMessage(rc)\n + \" - ledger=\" + ledgerId + \" - operation=\" + operation;\n\n if (entryId != -1) {\n mess... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_77 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java",
"identifier": "AvroSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testJodaTimeLogicalType() {\n AvroSchema<JodaTimeLogicalType> avroSchema = AvroSchema.of(SchemaDefinition.<JodaTimeLogicalType>builder()\n .withPojo(JodaTimeLogicalType.class).build());\n JodaTimeLogicalType schemaLogicalType = new JodaTimeLogicalType();\... | {
"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_98 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/generic/GenericSchemaImplTest.java",
"identifier": "GenericSchemaImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testKeyValueSchema() {\n // configure the schema info provider\n MultiVersionSchemaInfoProvider multiVersionSchemaInfoProvider = mock(MultiVersionSchemaInfoProvider.class);\n GenericSchema genericAvroSchema = GenericSchemaImpl.of(Schema.AVRO(Foo.class).getSchemaI... | {
"fields": [
{
"declarator": "fields",
"modifier": "protected final",
"original_string": "protected final List<Field> fields;",
"type": "List<Field>",
"var_name": "fields"
},
{
"declarator": "useProvidedSchemaAsReaderSchema",
"modifier": "protected final",
... | {
"body": "public static GenericSchemaImpl of(SchemaInfo schemaInfo) {\n return of(schemaInfo, true);\n }",
"class_method_signature": "GenericSchemaImpl.of(SchemaInfo schemaInfo)",
"constructor": false,
"full_signature": "public static GenericSchemaImpl of(SchemaInfo schemaInfo)",
"identifier": "of"... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_262 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/ExceptionsTest.java",
"identifier": "ExceptionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRethrowOtherExceptionAsIOException() throws IOException {\n Exception e = new Exception(\"test\");\n try {\n rethrowIOException(e);\n fail(\"Should rethrow IOException\");\n } catch (IOException ioe) {\n assertEquals(\"test\",... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Exceptions.java",
"identifier": "Exceptions",
"interfaces": "",
"methods": [
{
"class_method_signature": "Exceptions.rethrowIOException(Throwable cause)",
"constructor": false,
"full_signature... | {
"body": "public static void rethrowIOException(Throwable cause)\n throws IOException {\n if (cause instanceof IOException) {\n throw (IOException) cause;\n } else if (cause instanceof RuntimeException) {\n throw (RuntimeException) cause;\n } else if (cause insta... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_327 | {
"fields": [
{
"declarator": "config = new HashMap<>()",
"modifier": "private",
"original_string": "private Map<String, Object> config = new HashMap<>();",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "offsetTopicName",
"modifier": "priv... | {
"body": "@Test\n public void testOpenAndRead() throws Exception {\n kafkaConnectSource = new KafkaConnectSource();\n kafkaConnectSource.open(config, null);\n\n // use FileStreamSourceConnector, each line is a record, need \"\\n\" and end of each record.\n OutputStream os = Files.newOu... | {
"fields": [
{
"declarator": "readerCache =\n CacheBuilder.newBuilder().maximumSize(10000)\n .expireAfterAccess(30, TimeUnit.MINUTES).build()",
"modifier": "private final",
"original_string": "private final Cache<org.apache.kafka.connect.data.Schema, KafkaSchemaWra... | {
"body": "public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n if (config.get(JSON_WITH_ENVELOPE_CONFIG) != null) {\n jsonWithEnvelope = Boolean.parseBoolean(config.get(JSON_WITH_ENVELOPE_CONFIG).toString());\n config.put(JsonConverterConfig.SCHE... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_61 | {
"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 testConsumerBuilderImplWhenTopicNamesHasNullTopic() {\n List<String> topicNames = Arrays.asList(\"my-topic\", null);\n consumerBuilderImpl.topics(topicNames);\n }",
"class_method_signature": "ConsumerBuilderImplT... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private C... | {
"body": "@Override\n public ConsumerBuilder<T> topics(List<String> topicNames) {\n checkArgument(topicNames != null && !topicNames.isEmpty(),\n \"Passed in topicNames list should not be null or empty.\");\n topicNames.stream().forEach(topicName ->\n checkArgument(Strin... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_235 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentClassName() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"className\", \"Different\");\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionCo... | {
"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_370 | {
"fields": [
{
"declarator": "stringTopicName = TopicName.get(\"persistent\", \"tenant-1\", \"ns-1\", \"topic-1\")",
"modifier": "private static final",
"original_string": "private static final TopicName stringTopicName = TopicName.get(\"persistent\", \"tenant-1\", \"ns-1\", \"topic-1\");",
... | {
"body": "@Test\n public void testNewPulsarPrimitiveSchemaHandler() {\n RawMessage rawMessage = mock(RawMessage.class);\n SchemaHandler schemaHandler = PulsarSchemaHandlers.newPulsarSchemaHandler(\n null,\n null,\n StringSchema.utf8().getSchemaInfo(),\n ... | {
"fields": [
{
"declarator": "schemaInfo",
"modifier": "private final",
"original_string": "private final SchemaInfo schemaInfo;",
"type": "SchemaInfo",
"var_name": "schemaInfo"
},
{
"declarator": "schema",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n public Object deserialize(ByteBuf payload) {\n Object currentRecord = schema.decode(payload);\n switch (schemaInfo.getType()) {\n case DATE:\n return ((Date) currentRecord).getTime();\n case TIME:\n return ((Time) currentRecor... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_409 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtilsTest.java",
"identifier": "ProtocolHandlerUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLoadProtocolHandlerBlankHandlerClass() throws Exception {\n ProtocolHandlerDefinition def = new ProtocolHandlerDefinition();\n def.setDescription(\"test-protocol-handler\");\n\n String archivePath = \"/path/to/protocol/handler/nar\";\n\n ProtocolHandle... | {
"fields": [
{
"declarator": "PULSAR_PROTOCOL_HANDLER_DEFINITION_FILE = \"pulsar-protocol-handler.yml\"",
"modifier": "static final",
"original_string": "static final String PULSAR_PROTOCOL_HANDLER_DEFINITION_FILE = \"pulsar-protocol-handler.yml\";",
"type": "String",
"var_name": "P... | {
"body": "static ProtocolHandlerWithClassLoader load(ProtocolHandlerMetadata metadata,\n String narExtractionDirectory) throws IOException {\n NarClassLoader ncl = NarClassLoader.getFromArchive(\n metadata.getArchivePath().toAbsolutePath().toFile(),\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_36 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtilsTest.java",
"identifier": "ConfigurationDataUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLoadReaderConfigurationData() {\n ReaderConfigurationData confData = new ReaderConfigurationData();\n confData.setTopicName(\"unknown\");\n confData.setReceiverQueueSize(1000000);\n confData.setReaderName(\"unknown-reader\");\n Map<String, Objec... | {
"fields": [
{
"declarator": "mapper = new FastThreadLocal<ObjectMapper>() {\n @Override\n protected ObjectMapper initialValue() throws Exception {\n return create();\n }\n }",
"modifier": "private static final",
"original_string": "private static final FastTh... | {
"body": "public static <T> T loadData(Map<String, Object> config,\n T existingData,\n Class<T> dataCls) {\n ObjectMapper mapper = getThreadLocal();\n try {\n String existingConfigJson = mapper.writeValueAsString(existingData);\... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_167 | {
"fields": [
{
"declarator": "mockTable",
"modifier": "private",
"original_string": "private Table<ByteBuf, ByteBuf> mockTable;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "mockTable"
},
{
"declarator": "stateContext",
"modifier": "private",
"original_... | {
"body": "@Test\n public void testDelete() throws Exception {\n DeleteResult<ByteBuf, ByteBuf> result = mock(DeleteResult.class);\n when(mockTable.delete(any(ByteBuf.class), eq(Options.delete())))\n .thenReturn(FutureUtils.value(result));\n stateContext.delete(\"test-key\");\n ... | {
"fields": [
{
"declarator": "table",
"modifier": "private final",
"original_string": "private final Table<ByteBuf, ByteBuf> table;",
"type": "Table<ByteBuf, ByteBuf>",
"var_name": "table"
}
],
"file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/inst... | {
"body": "@Override\n public CompletableFuture<Void> delete(String key) {\n return table.delete(\n Unpooled.wrappedBuffer(key.getBytes(UTF_8)),\n Options.delete()\n ).thenApply(ignored -> null);\n }",
"class_method_signature": "StateContextImpl.delete(String key)",... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_537 | {
"fields": [
{
"declarator": "channel",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Channel channel;",
"type": "Channel",
"var_name": "channel"
},
{
"declarator": "eventLoop",
"modifier": "private",
"original_string": "private D... | {
"body": "@Test\n public void toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedBefore() throws Exception {\n Exception failure = new Exception();\n channelFuture.setFailure(failure);\n try {\n ChannelFutures.toCompletableFuture(channelFuture).get(1, TimeUnit.SE... | {
"fields": [],
"file": "pulsar-common/src/main/java/org/apache/pulsar/common/util/netty/ChannelFutures.java",
"identifier": "ChannelFutures",
"interfaces": "",
"methods": [
{
"class_method_signature": "ChannelFutures.ChannelFutures()",
"constructor": true,
"full_signature": "private Ch... | {
"body": "public static CompletableFuture<Channel> toCompletableFuture(ChannelFuture channelFuture) {\n Objects.requireNonNull(channelFuture, \"channelFuture cannot be null\");\n\n CompletableFuture<Channel> adapter = new CompletableFuture<>();\n if (channelFuture.isDone()) {\n if (ch... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_472 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java",
"identifier": "BookKeeperClientFactoryImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSetDiskWeightBasedPlacementEnabled() {\n BookKeeperClientFactoryImpl factory = new BookKeeperClientFactoryImpl();\n ServiceConfiguration conf = new ServiceConfiguration();\n conf.setZookeeperServers(\"localhost:2181\");\n assertFalse(factory.createBkCl... | {
"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_188 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"BatchSourceTriggerer does not implement the correct interface\")\n public void testWithoutRightTriggerer() throws Exception {\n testBatchConfig.setDiscoveryTriggererClassName(TestBatchSource.class.getName());... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_219 | {
"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 testMergeDifferentParallelism() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"parallelism\", 101);\n SourceConfig mergedConfig = SourceConfigUtils.validateUpdate(sourceConfig, newSourceConfig);\... | {
"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_560 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/FieldParserTest.java",
"identifier": "FieldParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMap() {\n Map<String, String> properties = Maps.newHashMap();\n properties.put(\"name\", \"config\");\n properties.put(\"stringStringMap\", \"key1=value1,key2=value2\");\n properties.put(\"stringIntMap\", \"key1=1,key2=2\");\n properties.put(\"l... | {
"fields": [
{
"declarator": "CONVERTERS = new HashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<String, Method> CONVERTERS = new HashMap<>();",
"type": "Map<String, Method>",
"var_name": "CONVERTERS"
},
{
"declarator": "WRA... | {
"body": "public static <T> void update(Map<String, String> properties, T obj) throws IllegalArgumentException {\n Field[] fields = obj.getClass().getDeclaredFields();\n Arrays.stream(fields).forEach(f -> {\n if (properties.containsKey(f.getName())) {\n try {\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_130 | {
"fields": [],
"file": "pulsar-functions/secrets/src/test/java/org/apache/pulsar/functions/secretsprovider/ClearTextSecretsProviderTest.java",
"identifier": "ClearTextSecretsProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConfigValidation() throws Exception {\n ClearTextSecretsProvider provider = new ClearTextSecretsProvider();\n assertEquals(provider.provideSecret(\"SecretName\", \"SecretValue\"), \"SecretValue\");\n assertEquals(provider.provideSecret(\"SecretName\", \"\"), ... | {
"fields": [],
"file": "pulsar-functions/secrets/src/main/java/org/apache/pulsar/functions/secretsprovider/ClearTextSecretsProvider.java",
"identifier": "ClearTextSecretsProvider",
"interfaces": "implements SecretsProvider",
"methods": [
{
"class_method_signature": "ClearTextSecretsProvider.provide... | {
"body": "@Override\n public String provideSecret(String secretName, Object pathToSecret) {\n if (pathToSecret != null) {\n return pathToSecret.toString();\n } else {\n return null;\n }\n }",
"class_method_signature": "ClearTextSecretsProvider.provideSecret(String 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_425 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeExclusiveStickyKeyConsumerSelectorTest.java",
"identifier": "HashRangeExclusiveStickyKeyConsumerSelectorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = BrokerServiceException.ConsumerAssignException.class)\n public void testNullKeySharedMeta() throws BrokerServiceException.ConsumerAssignException {\n HashRangeExclusiveStickyKeyConsumerSelector selector = new HashRangeExclusiveStickyKeyConsumerSelector(10);\n Con... | {
"fields": [
{
"declarator": "rangeSize",
"modifier": "private final",
"original_string": "private final int rangeSize;",
"type": "int",
"var_name": "rangeSize"
},
{
"declarator": "rangeMap",
"modifier": "private final",
"original_string": "private final Co... | {
"body": "@Override\n public void addConsumer(Consumer consumer) throws BrokerServiceException.ConsumerAssignException {\n validateKeySharedMeta(consumer);\n for (PulsarApi.IntRange intRange : consumer.getKeySharedMeta().getHashRangesList()) {\n rangeMap.put(intRange.getStart(), consumer)... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_8 | {
"fields": [],
"file": "pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java",
"identifier": "PulsarKafkaProducerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPulsarKafkaSendAvro() throws PulsarClientException {\n // Arrange\n PulsarClient mockClient = mock(PulsarClient.class);\n ProducerBuilder mockProducerBuilder = mock(ProducerBuilder.class);\n org.apache.pulsar.client.api.Producer mockProducer = mock(org... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClient client;",
"type": "PulsarClient",
"var_name": "client"
},
{
"declarator": "pulsarProducerBuilder",
"modifier": "private final",
"original_stri... | {
"body": "@Override\n public Future<RecordMetadata> send(ProducerRecord<K, V> record) {\n return send(record, null);\n }",
"class_method_signature": "PulsarKafkaProducer.send(ProducerRecord<K, V> record)",
"constructor": false,
"full_signature": "@Override public Future<RecordMetadata> send(Produc... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_126 | {
"fields": [
{
"declarator": "testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"})",
"modifier": "private final",
"original_string": "private final List<String> testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"});",
"type": "List<String>",
"var_name": "testStrin... | {
"body": "@Test\n public void testMapEntry() {\n TestConfig testConfig = createGoodConfig();\n testConfig.stringIntegerMap = testStringStringMap;\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage()... | {
"fields": [
{
"declarator": "DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class",
"modifier": "private static final",
"original_string": "private static final Class DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class;",
"type": "Class",
"var_name": "DEFAULT_ANNOT... | {
"body": "public static void validateConfig(Object config, Class annotationClass) {\n for (Field field : config.getClass().getDeclaredFields()) {\n Object value = null;\n field.setAccessible(true);\n try {\n value = field.get(config);\n } catch (Illeg... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_576 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/PersistencePoliciesTest.java",
"identifier": "PersistencePoliciesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPersistencePolicies() {\n PersistencePolicies policy0 = new PersistencePolicies();\n PersistencePolicies policy1 = new PersistencePolicies();\n assertEquals(policy1, policy0);\n assertNotEquals(new OldPolicies(), policy0);\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "bookkeeperEnsemble",
"modifier": "private",
"original_string": "private int bookkeeperEnsemble;",
"type": "int",
"var_name": "bookkeeperEnsemble"
},
{
"declarator": "bookkeeperWriteQuorum",
"modifier": "private",
"original_stri... | {
"body": "public PersistencePolicies() {\n this(2, 2, 2, 0.0);\n }",
"class_method_signature": "PersistencePolicies.PersistencePolicies()",
"constructor": true,
"full_signature": "public PersistencePolicies()",
"identifier": "PersistencePolicies",
"invocations": [],
"modifiers": "public",
"p... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_433 | {
"fields": [
{
"declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"",
"modifier": "private final",
"original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";",
"type": "String",
"var_nam... | {
"body": "@SuppressWarnings(\"deprecation\")\n @Test\n public void testTlsAuthUseTrustCert() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n final String subName = \"newSub\";\n Authentication auth;\n\n Set<String> providers = new HashSet<>();\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BrokerService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "@Override\n public void close() throws IOException {\n log.info(\"Shutting down Pulsar Broker service\");\n\n if (pulsar.getConfigurationCache() != null) {\n pulsar.getConfigurationCache().policiesCache().unregisterListener(this);\n }\n\n // unloads all namespaces ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_258 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Output Schema mismatch\")\n public void testMergeDifferentOutputSchemaTypes() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctio... | {
"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_521 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/RateLimiterTest.java",
"identifier": "RateLimiterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRateLimiterWithFunction()throws Exception {\n final AtomicInteger atomicInteger = new AtomicInteger(0);\n long permits = 10;\n long rateTime = 1;\n int reNewTime = 3;\n RateLimitFunction rateLimitFunction = atomicInteger::incrementAndGet;\n ... | {
"fields": [
{
"declarator": "executorService",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executorService;",
"type": "ScheduledExecutorService",
"var_name": "executorService"
},
{
"declarator": "rateTime",
"modifier":... | {
"body": "synchronized void renew() {\n acquiredPermits = 0;\n if (permitUpdater != null) {\n long newPermitRate = permitUpdater.get();\n if (newPermitRate > 0) {\n setRate(newPermitRate);\n }\n }\n if (rateLimitFunction != null) {\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_171 | {
"fields": [],
"file": "pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/instance/InstanceUtilsTest.java",
"identifier": "InstanceUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCalculateSubjectTypeForFunction() {\n FunctionDetails.Builder builder = FunctionDetails.newBuilder();\n // an input but no sink classname is a function\n builder.setSource(Function.SourceSpec.newBuilder().putInputSpecs(\"topic\", Function.ConsumerSpec.newBuil... | {
"fields": [],
"file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceUtils.java",
"identifier": "InstanceUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "InstanceUtils.initializeSerDe(String serdeClassName, ClassLoader clsLoader, Class<?> t... | {
"body": "public Function.FunctionDetails.ComponentType calculateSubjectType(Function.FunctionDetails functionDetails) {\n if (functionDetails.getComponentType() != Function.FunctionDetails.ComponentType.UNKNOWN) {\n return functionDetails.getComponentType();\n }\n Function.SourceSpec... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_464 | {
"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 testLoadBrokerEventListenerWithWrongListerClass() throws Exception {\n BrokerInterceptorDefinition def = new BrokerInterceptorDefinition();\n def.setInterceptorClass(Runnable.class.getName());\n def.setDescription(\"test-br... | {
"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_413 | {
"fields": [
{
"declarator": "protocol1 = \"protocol1\"",
"modifier": "private static final",
"original_string": "private static final String protocol1 = \"protocol1\";",
"type": "String",
"var_name": "protocol1"
},
{
"declarator": "handler1",
"modifier": "privat... | {
"body": "@Test\n public void testGetProtocolDataToAdvertise() {\n String protocolData1 = \"protocolData1\";\n String protocolData2 = \"protocolData2\";\n when(handler1.getProtocolDataToAdvertise()).thenReturn(protocolData1);\n when(handler2.getProtocolDataToAdvertise()).thenReturn(pro... | {
"fields": [
{
"declarator": "handlers",
"modifier": "private final",
"original_string": "private final Map<String, ProtocolHandlerWithClassLoader> handlers;",
"type": "Map<String, ProtocolHandlerWithClassLoader>",
"var_name": "handlers"
}
],
"file": "pulsar-broker/src/main/... | {
"body": "public Map<String, String> getProtocolDataToAdvertise() {\n return handlers.entrySet().stream()\n .collect(Collectors.toMap(\n e -> e.getKey(),\n e -> e.getValue().getProtocolDataToAdvertise()\n ));\n }",
"class_method_signature": "ProtocolHan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_106 | {
"fields": [
{
"declarator": "NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"foo\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "EXPECTED_SCHEMA_JSON = \"{\\\"type\\\":\\\"record\\\",\\\"name\... | {
"body": "@Test\n public void testDecodeByteBuf() throws JsonProcessingException {\n ProtobufSchema<org.apache.pulsar.client.schema.proto.Test.TestMessage> protobufSchema\n = ProtobufSchema.of(org.apache.pulsar.client.schema.proto.Test.TestMessage.class);\n org.apache.pulsar.client.sc... | {
"fields": [
{
"declarator": "PARSING_INFO_PROPERTY = \"__PARSING_INFO__\"",
"modifier": "public static final",
"original_string": "public static final String PARSING_INFO_PROPERTY = \"__PARSING_INFO__\";",
"type": "String",
"var_name": "PARSING_INFO_PROPERTY"
}
],
"file": "... | {
"body": "public static <T extends com.google.protobuf.GeneratedMessageV3> ProtobufSchema<T> of(Class<T> pojo) {\n return of(pojo, new HashMap<>());\n }",
"class_method_signature": "ProtobufSchema.of(Class<T> pojo)",
"constructor": false,
"full_signature": "public static ProtobufSchema<T> of(Class<T>... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_556 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/GrowablePriorityLongPairQueueTest.java",
"identifier": "GrowablePriorityLongPairQueueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testItems() {\n GrowablePriorityLongPairQueue queue = new GrowablePriorityLongPairQueue();\n\n int n = 100;\n int limit = 10;\n for (int i = 0; i < n; i++) {\n queue.add(i, i);\n }\n\n Set<LongPair> items = queue.items();\n ... | {
"fields": [
{
"declarator": "data",
"modifier": "private",
"original_string": "private long[] data;",
"type": "long[]",
"var_name": "data"
},
{
"declarator": "capacity",
"modifier": "private",
"original_string": "private int capacity;",
"type": "int"... | {
"body": "public Set<LongPair> items() {\n Set<LongPair> items = new HashSet<>(this.size);\n forEach((item1, item2) -> items.add(new LongPair(item1, item2)));\n return items;\n }",
"class_method_signature": "GrowablePriorityLongPairQueue.items()",
"constructor": false,
"full_signature":... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_385 | {
"fields": [
{
"declarator": "SUBJECT = \"my-test-subject\"",
"modifier": "private static final",
"original_string": "private static final String SUBJECT = \"my-test-subject\";",
"type": "String",
"var_name": "SUBJECT"
}
],
"file": "pulsar-broker-common/src/test/java/org/apa... | {
"body": "@Test(expectedExceptions = IOException.class)\n public void testInitializeWhenSecretKeyFilePathIsInvalid() throws IOException {\n Properties properties = new Properties();\n properties.setProperty(AuthenticationProviderToken.CONF_TOKEN_SECRET_KEY,\n \"file://\" + \"invalid_s... | {
"fields": [
{
"declarator": "HTTP_HEADER_NAME = \"Authorization\"",
"modifier": "final static",
"original_string": "final static String HTTP_HEADER_NAME = \"Authorization\";",
"type": "String",
"var_name": "HTTP_HEADER_NAME"
},
{
"declarator": "HTTP_HEADER_VALUE_PREFI... | {
"body": "@Override\n public void initialize(ServiceConfiguration config) throws IOException, IllegalArgumentException {\n // we need to fetch the algorithm before we fetch the key\n this.publicKeyAlg = getPublicKeyAlgType(config);\n this.validationKey = getValidationKey(config);\n thi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_444 | {
"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 testProducerFailureOnEncryptionRequiredTopic() throws Exception {\n resetChannel();\n setChannelConnected();\n\n // Set encryption_required to true\n ZooKeeperDataCache<Policies> zkDataCache = mock(ZooKeeperDataCache.class);\n Polic... | {
"fields": [
{
"declarator": "service",
"modifier": "private final",
"original_string": "private final BrokerService service;",
"type": "BrokerService",
"var_name": "service"
},
{
"declarator": "schemaService",
"modifier": "private final",
"original_string"... | {
"body": "public ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers() {\n return producers;\n }",
"class_method_signature": "ServerCnx.getProducers()",
"constructor": false,
"full_signature": "public ConcurrentLongHashMap<CompletableFuture<Producer>> getProducers()",
"identifier": "get... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_501 | {
"fields": [
{
"declarator": "SERVICE_URL = \"pulsar://localhost:6650\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_URL = \"pulsar://localhost:6650\";",
"type": "String",
"var_name": "SERVICE_URL"
},
{
"declarator": "TO... | {
"body": "@Test\n public void testEmitDataStream() throws Exception {\n DataStream mockedDataStream = Mockito.mock(DataStream.class);\n\n PulsarAvroTableSink sink = spySink();\n\n sink.emitDataStream(mockedDataStream);\n\n Mockito.verify(mockedDataStream).addSink(Mockito.any(FlinkPulsa... | {
"fields": [
{
"declarator": "clientConfigurationData",
"modifier": "protected",
"original_string": "protected ClientConfigurationData clientConfigurationData;",
"type": "ClientConfigurationData",
"var_name": "clientConfigurationData"
},
{
"declarator": "producerConfig... | {
"body": "@Override\n public void emitDataStream(DataStream<Row> dataStream) {\n checkState(fieldNames != null, \"Table sink is not configured\");\n checkState(fieldTypes != null, \"Table sink is not configured\");\n checkState(serializationSchema != null, \"Table sink is not configured\");\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_151 | {
"fields": [
{
"declarator": "factory",
"modifier": "private",
"original_string": "private KubernetesRuntimeFactory factory;",
"type": "KubernetesRuntimeFactory",
"var_name": "factory"
},
{
"declarator": "userJarFile",
"modifier": "private final",
"original... | {
"body": "@Test\n public void testValidateMinResourcesRequired() throws Exception {\n factory = createKubernetesRuntimeFactory(null, null);\n\n FunctionDetails functionDetailsBase = createFunctionDetails();\n\n // min resources are not set\n try {\n factory.validateMinResour... | {
"fields": [
{
"declarator": "NUM_RETRIES = 5",
"modifier": "static",
"original_string": "static int NUM_RETRIES = 5;",
"type": "int",
"var_name": "NUM_RETRIES"
},
{
"declarator": "SLEEP_BETWEEN_RETRIES_MS = 500",
"modifier": "static",
"original_string": "s... | {
"body": "void validateMinResourcesRequired(Function.FunctionDetails functionDetails) {\n if (functionInstanceMinResources != null) {\n Double minCpu = functionInstanceMinResources.getCpu();\n Long minRam = functionInstanceMinResources.getRam();\n\n if (minCpu != null) {\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_94 | {
"fields": [
{
"declarator": "writerSchema",
"modifier": "private",
"original_string": "private GenericAvroSchema writerSchema;",
"type": "GenericAvroSchema",
"var_name": "writerSchema"
},
{
"declarator": "readerSchema",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testDecodeWithMultiVersioningSupport() {\n MultiVersionSchemaInfoProvider provider = mock(MultiVersionSchemaInfoProvider.class);\n readerSchema.setSchemaInfoProvider(provider);\n when(provider.getSchemaByVersion(any(byte[].class)))\n .thenReturn(Comple... | {
"fields": [
{
"declarator": "OFFSET_PROP = \"__AVRO_READ_OFFSET__\"",
"modifier": "public final static",
"original_string": "public final static String OFFSET_PROP = \"__AVRO_READ_OFFSET__\";",
"type": "String",
"var_name": "OFFSET_PROP"
}
],
"file": "pulsar-client/src/main... | {
"body": "@Override\n public GenericRecordBuilder newRecordBuilder() {\n return new AvroRecordBuilderImpl(this);\n }",
"class_method_signature": "GenericAvroSchema.newRecordBuilder()",
"constructor": false,
"full_signature": "@Override public GenericRecordBuilder newRecordBuilder()",
"identifier... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_278 | {
"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 = \"Retain Ordering cannot be altered\")\n public void testMergeDifferentRetainOrdering() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"retain... | {
"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_297 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ZookeeperCacheTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ZookeeperCacheTest.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Test\n public void testTimedOutZKCacheRequestInvalidates() throws Exception {\n\n OrderedScheduler executor = OrderedScheduler.newSchedulerBuilder().build();\n ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(2);\n ExecutorService zkExecutor = Executors... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperCache.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public <T> Optional<T> getData(final String path, final Deserializer<T> deserializer) throws Exception {\n return getData(path, this, deserializer).map(e -> e.getKey());\n }",
"class_method_signature": "ZooKeeperCache.getData(final String path, final Deserializer<T> deserializer)",
"construct... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_452 | {
"fields": [
{
"declarator": "underlyingService",
"modifier": "private",
"original_string": "private SchemaRegistryService underlyingService;",
"type": "SchemaRegistryService",
"var_name": "underlyingService"
},
{
"declarator": "service",
"modifier": "private",
... | {
"body": "@Test\n public void testDeleteSchema() {\n String schemaId = \"test-schema-id\";\n String user = \"test-user\";\n CompletableFuture<SchemaVersion> deleteFuture = new CompletableFuture<>();\n when(underlyingService.deleteSchema(eq(schemaId), eq(user)))\n .thenReturn... | {
"fields": [
{
"declarator": "service",
"modifier": "private final",
"original_string": "private final SchemaRegistryService service;",
"type": "SchemaRegistryService",
"var_name": "service"
}
],
"file": "pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/va... | {
"body": "@Override\n public CompletableFuture<SchemaVersion> deleteSchema(String schemaId, String user) {\n return service.deleteSchema(schemaId, user);\n }",
"class_method_signature": "SchemaRegistryServiceWithSchemaDataValidator.deleteSchema(String schemaId, String user)",
"constructor": false,
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_82 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java",
"identifier": "JSONSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllowNullEncodeAndDecode() {\n JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());\n\n Bar bar = new Bar();\n bar.setField1(true);\n\n Foo foo1 = new Foo();\n foo1.setField1(\"foo1\");\n ... | {
"fields": [
{
"declarator": "JSON_MAPPER = ThreadLocal.withInitial(() -> {\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n return mapper... | {
"body": "public static <T> JSONSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n SchemaReader<T> reader = schemaDefinition.getSchemaReaderOpt()\n .orElseGet(() -> new JacksonJsonReader<>(JSON_MAPPER.get(), schemaDefinition.getPojo()));\n SchemaWriter<T> writer = schemaDefinition.ge... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_147 | {
"fields": [
{
"declarator": "producerByteArray",
"modifier": "static",
"original_string": "static byte[] producerByteArray;",
"type": "byte[]",
"var_name": "producerByteArray"
}
],
"file": "pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/FunctionMet... | {
"body": "@Test\n public void processUpdateTest() throws PulsarClientException {\n SchedulerManager schedulerManager = mock(SchedulerManager.class);\n WorkerConfig workerConfig = new WorkerConfig();\n workerConfig.setWorkerId(\"worker-1\");\n FunctionMetaDataManager functionMetaDataMan... | {
"fields": [
{
"declarator": "functionMetaDataMap = new ConcurrentHashMap<>()",
"modifier": "@VisibleForTesting\n final",
"original_string": "@VisibleForTesting\n final Map<String, Map<String, Map<String, FunctionMetaData>>> functionMetaDataMap = new ConcurrentHashMap<>();",
"type":... | {
"body": "@VisibleForTesting\n synchronized boolean processUpdate(FunctionMetaData updateRequestFs) throws IllegalArgumentException {\n\n log.debug(\"Process update request: {}\", updateRequestFs);\n\n boolean needsScheduling = false;\n\n // Worker doesn't know about the function so far\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_517 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/protocol/MarkersTest.java",
"identifier": "MarkersTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTxnAbortMarker() {\n long sequenceId = 1L;\n long mostBits = 1234L;\n long leastBits = 2345L;\n\n ByteBuf buf = Markers.newTxnAbortMarker(sequenceId, mostBits, leastBits);\n\n MessageMetadata msgMetadata = Commands.parseMessageMetadata(buf);\n\n... | {
"fields": [],
"file": "pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Markers.java",
"identifier": "Markers",
"interfaces": "",
"methods": [
{
"class_method_signature": "Markers.newMessage(MarkerType markerType, Optional<String> restrictToCluster, ByteBuf payload)",
"construct... | {
"body": "public static ByteBuf newTxnAbortMarker(long sequenceId, long txnMostBits,\n long txnLeastBits) {\n return newTxnMarker(MarkerType.TXN_ABORT, sequenceId, txnMostBits, txnLeastBits, Optional.empty());\n }",
"class_method_signature": "Markers.newTxnAbort... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_281 | {
"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 = \"AutoAck cannot be altered\")\n public void testMergeDifferentAutoAck() {\n SinkConfig sinkConfig = createSinkConfig();\n SinkConfig newSinkConfig = createUpdatedSinkConfig(\"autoAck\", false);\n ... | {
"fields": [],
"file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java",
"identifier": "SinkConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SinkConfigUtils.convert(SinkConfig sinkConfig, ExtractedSinkDetails sinkDetails)",
... | {
"body": "public static SinkConfig validateUpdate(SinkConfig existingConfig, SinkConfig newConfig) {\n SinkConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenants differ\");\n ... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_405 | {
"fields": [
{
"declarator": "TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\"",
"modifier": "private final static",
"original_string": "private final static String TLS_CLIENT_CERT_FILE_PATH = \"./src/test/resources/certificate/client.crt\";",
"type": "String",
... | {
"body": "@Test\n public void testGetPartitionsMetadata() throws Exception {\n TopicName topic1 = TopicName.get(\"persistent://test/local/ns/my-topic-1\");\n\n PartitionedTopicMetadata m = service.getDiscoveryProvider().getPartitionedTopicMetadata(service, topic1, \"role\", null)\n .g... | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final ServiceConfig config;",
"type": "ServiceConfig",
"var_name": "config"
},
{
"declarator": "serviceUrl",
"modifier": "private",
"original_string": "private S... | {
"body": "public BrokerDiscoveryProvider getDiscoveryProvider() {\n return discoveryProvider;\n }",
"class_method_signature": "DiscoveryService.getDiscoveryProvider()",
"constructor": false,
"full_signature": "public BrokerDiscoveryProvider getDiscoveryProvider()",
"identifier": "getDiscoveryProvid... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_540 | {
"fields": [],
"file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/ConcurrentBitSetRecyclableTest.java",
"identifier": "ConcurrentBitSetRecyclableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRecycle() {\n ConcurrentBitSetRecyclable bitset1 = ConcurrentBitSetRecyclable.create();\n bitset1.set(3);\n bitset1.recycle();\n ConcurrentBitSetRecyclable bitset2 = ConcurrentBitSetRecyclable.create();\n ConcurrentBitSetRecyclable bitset3 = Con... | {
"fields": [
{
"declarator": "recyclerHandle",
"modifier": "private final",
"original_string": "private final Handle<ConcurrentBitSetRecyclable> recyclerHandle;",
"type": "Handle<ConcurrentBitSetRecyclable>",
"var_name": "recyclerHandle"
},
{
"declarator": "RECYCLER = ... | {
"body": "public void recycle() {\n this.clear();\n recyclerHandle.recycle(this);\n }",
"class_method_signature": "ConcurrentBitSetRecyclable.recycle()",
"constructor": false,
"full_signature": "public void recycle()",
"identifier": "recycle",
"invocations": [
"clear",
"recycle"
... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_110 | {
"fields": [
{
"declarator": "executorService = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executorService = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executorService"
... | {
"body": "@Test(invocationTimeOut = 1000)\n public void testNotifyPendingReceivedCallback_CompleteWithExceptionWhenMessageIsNull() {\n CompletableFuture<Message<ConsumerImpl>> receiveFuture = new CompletableFuture<>();\n consumer.pendingReceives.add(receiveFuture);\n consumer.notifyPendingRec... | {
"fields": [
{
"declarator": "MAX_REDELIVER_UNACKNOWLEDGED = 1000",
"modifier": "private static final",
"original_string": "private static final int MAX_REDELIVER_UNACKNOWLEDGED = 1000;",
"type": "int",
"var_name": "MAX_REDELIVER_UNACKNOWLEDGED"
},
{
"declarator": "con... | {
"body": "void notifyPendingReceivedCallback(final Message<T> message, Exception exception) {\n if (pendingReceives.isEmpty()) {\n return;\n }\n\n // fetch receivedCallback from queue\n final CompletableFuture<Message<T>> receivedFuture = pendingReceives.poll();\n if (re... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_239 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeDifferentLogTopic() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionConfig(\"logTopic\", \"Different\");\n FunctionConfig mergedConfig = FunctionConfigUtils.validateUpdate(functionConf... | {
"fields": [
{
"declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)",
"modifier": "static final",
"original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);",
"type": "Integer",
"var_name": "MAX_PENDING_ASYNC_REQUESTS_DE... | {
"body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_393 | {
"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 testDifferentListenerWithSameHostPort() {\n ServiceConfiguration config = new ServiceConfiguration();\n config.setAdvertisedListeners(\" internal:pulsar://127.0.0.1:6660,\" + \" external:pulsar://127.0.0.1:6660\");\n ... | {
"fields": [],
"file": "pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java",
"identifier": "MultipleListenerValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "MultipleListenerValidator.validateAndAnalysisAdvertisedListener(Servi... | {
"body": "public static Map<String, AdvertisedListener> validateAndAnalysisAdvertisedListener(ServiceConfiguration config) {\n if (StringUtils.isNotBlank(config.getAdvertisedListeners()) && StringUtils.isNotBlank(config.getAdvertisedAddress())) {\n throw new IllegalArgumentException(\"`advertisedLi... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_491 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java",
"identifier": "PulsarBrokerStarterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMainEnableRunBookieThroughBrokerConfig() throws Exception {\n try {\n File testConfigFile = createValidBrokerConfigFile();\n String[] args = {\"-c\", testConfigFile.getAbsolutePath()};\n PulsarBrokerStarter.main(args);\n fail(\"N... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);",
"type": "Logger",
"var_name": "log"
}
],
"... | {
"body": "public static void main(String[] args) throws Exception {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss,SSS\");\n Thread.setDefaultUncaughtExceptionHandler((thread, exception) -> {\n System.out.println(String.format(\"%s [%s] error Uncaught exception in threa... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_41 | {
"fields": [
{
"declarator": "TOPIC_NAME = \"testTopicName\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_NAME = \"testTopicName\";",
"type": "String",
"var_name": "TOPIC_NAME"
},
{
"declarator": "client",
"modifier"... | {
"body": "@Test\n public void testGetStats() throws Exception {\n String topicName = \"test-stats\";\n ClientConfigurationData conf = new ClientConfigurationData();\n conf.setServiceUrl(\"pulsar://localhost:6650\");\n conf.setStatsIntervalSeconds(100);\n\n ThreadFactory threadFa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PartitionedProducerImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PartitionedProducerImpl.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "@Override\n public synchronized ProducerStatsRecorderImpl getStats() {\n if (stats == null) {\n return null;\n }\n stats.reset();\n for (int i = 0; i < topicMetadata.numPartitions(); i++) {\n stats.updateCumulativeStats(producers.get(i).getStats());\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_184 | {
"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 testGetStateStateEnabled() throws Exception {\n context.stateContext = mock(StateContextImpl.class);\n context.getStateAsync(\"test-key\");\n verify(context.stateContext, times(1)).get(eq(\"test-key\"));\n }",
"class_method_signature": "ContextImplTest.testG... | {
"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<ByteBuffer> getStateAsync(String key) {\n ensureStateEnabled();\n return stateContext.get(key);\n }",
"class_method_signature": "ContextImpl.getStateAsync(String key)",
"constructor": false,
"full_signature": "@Override public CompletableFuture... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_307 | {
"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 testDeleteOffloaded() throws Exception {\n ReadHandle readHandle = buildReadHandle(DEFAULT_BLOCK_SIZE, 1);\n UUID uuid = UUID.randomUUID();\n LedgerOffloader offloader = new BlobStoreManagedLedgerOffloader(blobStore, BUCKET, scheduler,\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);",
"type": "Logger",
"var_nam... | {
"body": "@Override\n public CompletableFuture<Void> deleteOffloaded(long ledgerId, UUID uid,\n Map<String, String> offloadDriverMetadata) {\n String readBucket = getReadBucket(offloadDriverMetadata);\n BlobStore readBlobstore = getReadBlobStore(offl... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_242 | {
"fields": [],
"file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java",
"identifier": "FunctionConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Retain Ordering cannot be altered\")\n public void testMergeDifferentRetainOrdering() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdate... | {
"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_583 | {
"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 testGetPrimaryBrokers() throws Exception {\n List<String> primaryBrokers = this.getDefaultPolicy().getPrimaryBrokers();\n assertEquals(primaryBrokers.size(), 1);\n assertEquals(primaryBrokers.get(0), \"prod1-broker[1-3].messaging.use.example.com\");\n }",
"c... | {
"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> getPrimaryBrokers() {\n return this.primary;\n }",
"class_method_signature": "NamespaceIsolationPolicyImpl.getPrimaryBrokers()",
"constructor": false,
"full_signature": "@Override public List<String> getPrimaryBrokers()",
"identifier": "getPrimaryBrokers... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_429 | {
"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 testTlsDisabled() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n final String subName = \"newSub\";\n PulsarClient pulsarClient = null;\n\n conf.setAuthenticationEnabled(false);\n restartBroker();\n\n /... | {
"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_16 | {
"fields": [],
"file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/BackoffTest.java",
"identifier": "BackoffTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void basicTest() {\n Clock mockClock = Clock.fixed(Instant.EPOCH, ZoneId.systemDefault());\n Backoff backoff = new Backoff(5, TimeUnit.MILLISECONDS, 60, TimeUnit.SECONDS, 60, TimeUnit.SECONDS, mockClock);\n assertTrue(checkExactAndDecrementTimer(backoff, 5));\n ... | {
"fields": [
{
"declarator": "DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100)",
"modifier": "public static final",
"original_string": "public static final long DEFAULT_INTERVAL_IN_NANOSECONDS = TimeUnit.MILLISECONDS.toNanos(100);",
"type": "long",
"var_name": "D... | {
"body": "public void reset() {\n this.next = this.initial;\n this.mandatoryStopMade = false;\n }",
"class_method_signature": "Backoff.reset()",
"constructor": false,
"full_signature": "public void reset()",
"identifier": "reset",
"invocations": [],
"modifiers": "public",
"parameters":... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_350 | {
"fields": [],
"file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java",
"identifier": "TestAbstractConfigurationProvider",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSinkThrowsExceptionDuringConfiguration() throws Exception {\n String agentName = \"agent1\";\n String sourceType = \"seq\";\n String channelType = \"memory\";\n String sinkType = UnconfigurableSink.class.getName();\n Map<String, String> properti... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);",
"type": "Logger",
"var_n... | {
"body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_215 | {
"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 testMergeDifferentClassName() {\n SourceConfig sourceConfig = createSourceConfig();\n SourceConfig newSourceConfig = createUpdatedSourceConfig(\"className\", \"Different\");\n SourceConfig mergedConfig = SourceConfigUtils.validateUpdate(sourceConfig, newSourceCon... | {
"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_595 | {
"fields": [],
"file": "managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/MetaStoreImplTest.java",
"identifier": "MetaStoreImplTest",
"interfaces": "",
"superclass": "extends MockedBookKeeperTestCase"
} | {
"body": "@Test(timeOut = 20000)\n void readMalformedML() throws Exception {\n MetaStore store = new MetaStoreImpl(new ZKMetadataStore(zkc), executor);\n\n zkc.create(\"/managed-ledgers/my_test\", \"non-valid\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n\n ... | {
"fields": [
{
"declarator": "BASE_NODE = \"/managed-ledgers\"",
"modifier": "private static final",
"original_string": "private static final String BASE_NODE = \"/managed-ledgers\";",
"type": "String",
"var_name": "BASE_NODE"
},
{
"declarator": "PREFIX = BASE_NODE + \... | {
"body": "@Override\n public void getManagedLedgerInfo(String ledgerName, boolean createIfMissing,\n MetaStoreCallback<ManagedLedgerInfo> callback) {\n // Try to get the content or create an empty node\n String path = PREFIX + ledgerName;\n store.get(path)\n .thenAcc... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_346 | {
"fields": [],
"file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java",
"identifier": "TestAbstractConfigurationProvider",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnspecifiedChannel() throws Exception {\n String agentName = \"agent1\";\n Map<String, String> properties = getPropertiesForChannel(agentName,\n UnspecifiedChannel.class.getName());\n MemoryConfigurationProvider provider =\n new ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);",
"type": "Logger",
"var_n... | {
"body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_203 | {
"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 testInconsistentOutputType() throws IOException {\n PulsarSinkConfig pulsarConfig = getPulsarConfigs();\n // set type to be inconsistent to that of SerDe\n pulsarConfig.setTypeClassName(Integer.class.getName());\n pulsarConfig.setSerdeClassName(TestSerDe.c... | {
"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_4 | {
"fields": [],
"file": "pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/pulsar/client/kafka/compat/KafkaProducerInterceptorWrapperTest.java",
"identifier": "KafkaProducerInterceptorWrapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProducerInterceptorConvertRecordCorrectly() {\n\n String topic = \"topic name\";\n int partitionID = 666;\n long timeStamp = Math.abs(new Random().nextLong());\n\n org.apache.kafka.clients.producer.ProducerInterceptor<String, byte[]> mockInterceptor1 =... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KafkaProducerInterceptorWrapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KafkaProducerInterceptorWrapper.class);",
"type": "Logger",
"var_nam... | {
"body": "@Override\n public Message<byte[]> beforeSend(Producer<byte[]> producer, Message<byte[]> message) {\n return toPulsarMessage(kafkaProducerInterceptor.onSend(toKafkaRecord(message)));\n }",
"class_method_signature": "KafkaProducerInterceptorWrapper.beforeSend(Producer<byte[]> producer, Messag... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_487 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java",
"identifier": "PulsarBrokerStarterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMainWithNoArgument() throws Exception {\n try {\n PulsarBrokerStarter.main(new String[0]);\n fail(\"No argument to main should've raised FileNotFoundException for no broker config!\");\n } catch (FileNotFoundException e) {\n // code ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);",
"type": "Logger",
"var_name": "log"
}
],
"... | {
"body": "public static void main(String[] args) throws Exception {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss,SSS\");\n Thread.setDefaultUncaughtExceptionHandler((thread, exception) -> {\n System.out.println(String.format(\"%s [%s] error Uncaught exception in threa... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_468 | {
"fields": [],
"file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/AggregatedNamespaceStatsTest.java",
"identifier": "AggregatedNamespaceStatsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimpleAggregation() throws Exception {\n final String namespace = \"tenant/cluster/ns\";\n\n TopicStats topicStats1 = new TopicStats();\n topicStats1.subscriptionsCount = 2;\n topicStats1.producersCount = 1;\n topicStats1.consumersCount = 3;\n ... | {
"fields": [
{
"declarator": "topicsCount",
"modifier": "public",
"original_string": "public int topicsCount;",
"type": "int",
"var_name": "topicsCount"
},
{
"declarator": "subscriptionsCount",
"modifier": "public",
"original_string": "public int subscripti... | {
"body": "void updateStats(TopicStats stats) {\n topicsCount++;\n\n subscriptionsCount += stats.subscriptionsCount;\n producersCount += stats.producersCount;\n consumersCount += stats.consumersCount;\n\n rateIn += stats.rateIn;\n rateOut += stats.rateOut;\n throughput... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_192 | {
"fields": [
{
"declarator": "testBatchSource",
"modifier": "private",
"original_string": "private TestBatchSource testBatchSource;",
"type": "TestBatchSource",
"var_name": "testBatchSource"
},
{
"declarator": "testBatchPushSource",
"modifier": "private",
"... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"BatchSource does not implement the correct interface\")\n public void testWithoutRightSource() throws Exception {\n config.put(BatchSourceConfig.BATCHSOURCE_CLASSNAME_KEY, TestDiscoveryTriggerer.class.getName... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private Map<String, Object> config;",
"type": "Map<String, Object>",
"var_name": "config"
},
{
"declarator": "sourceContext",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {\n this.config = config;\n this.sourceContext = sourceContext;\n this.intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(sourceContext.getTenant(),\n s... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_57 | {
"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 testConsumerBuilderImplWhenTopicNamesVarargsHasBlankTopic() {\n consumerBuilderImpl.topic(\"my-topic\", \" \");\n }",
"class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenTopicNamesVarargsHasBl... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PulsarClientImpl client;",
"type": "PulsarClientImpl",
"var_name": "client"
},
{
"declarator": "conf",
"modifier": "private",
"original_string": "private C... | {
"body": "@Override\n public ConsumerBuilder<T> topic(String... topicNames) {\n checkArgument(topicNames != null && topicNames.length > 0,\n \"Passed in topicNames should not be null or empty.\");\n Arrays.stream(topicNames).forEach(topicName ->\n checkArgument(StringUt... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 62117812,
"size": null,
"stargazer_count": null,
"stars": 5004,
"updates": "2020-01-27T18:49:26+00:00",
"url": "https://github.com/apache/pulsar"
... |
62117812_311 | {
"fields": [],
"file": "pulsar-io/netty/src/test/java/org/apache/pulsar/io/netty/udp/NettyUDPChannelInitializerTest.java",
"identifier": "NettyUDPChannelInitializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testChannelInitializer() throws Exception {\n NioDatagramChannel channel = new NioDatagramChannel();\n\n NettyUDPChannelInitializer nettyChannelInitializer = new NettyUDPChannelInitializer(\n new NettyUDPServerHandler(new NettySource()));\n nettyCh... | {
"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/udp/NettyUD... | {
"body": "@Override\n protected void initChannel(Channel channel) throws Exception {\n channel.pipeline().addLast(this.handler);\n }",
"class_method_signature": "NettyUDPChannelInitializer.initChannel(Channel channel)",
"constructor": false,
"full_signature": "@Override protected void initChannel(... | {
"created": "6/28/2016 7:00:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"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.