docstring_tokens
list | code_tokens
list |
---|---|
[
"returns",
"the",
"set",
"of",
"values",
"in",
"this",
"graph"
]
| [
"public",
"synchronized",
"set",
"<",
"t",
">",
"get",
"values",
"(",
")",
"{",
"return",
"new",
"hash",
"set",
"<",
">",
"(",
"node",
"map",
"key",
"set",
"(",
")",
")",
";",
"}"
]
|
[
"sets",
"index",
"settings",
"that",
"should",
"be",
"added",
"or",
"replaced",
"during",
"restore"
]
| [
"public",
"restore",
"snapshot",
"request",
"builder",
"set",
"index",
"settings",
"(",
"map",
"<",
"string",
",",
"object",
">",
"source",
")",
"{",
"request",
"index",
"settings",
"(",
"source",
")",
";",
"return",
"this",
";",
"}"
]
|
[
"print",
"all",
"statistics",
"for",
"all",
"file",
"systems",
"to",
"{",
"@",
"code",
"system",
"out",
"}"
]
| [
"void",
"print",
"statistics",
"(",
")",
"throws",
"i",
"o",
"exception",
"{",
"for",
"(",
"map",
"entry",
"<",
"class",
"<",
"?",
"extends",
"file",
"system",
">",
",",
"statistics",
">",
"pair",
":",
"statistics",
"table",
"entry",
"set",
"(",
")",
")",
"{",
"system",
"out",
"println",
"(",
"\"",
"file",
"system",
"\"",
"+",
"pair",
"get",
"key",
"(",
")",
"get",
"name",
"(",
")",
"+",
"\"",
":",
"\"",
"+",
"pair",
"get",
"value",
"(",
")",
")",
";",
"}",
"}"
]
|
[
"set",
"the",
"passcode",
"for",
"the",
"shared",
"\"",
"system",
"\"",
"connection",
"used",
"to",
"send",
"messages",
"to",
"the",
"stomp",
"broker",
"from",
"within",
"the",
"application",
",",
"i",
"e",
"messages",
"not",
"associated",
"with",
"a",
"specific",
"client",
"session",
"(",
"e",
"g",
"resthttp",
"request",
"handling",
"method",
")",
"by",
"default",
"this",
"is",
"set",
"to",
"\"",
"guest",
"\""
]
| [
"public",
"void",
"set",
"system",
"passcode",
"(",
"string",
"system",
"passcode",
")",
"{",
"this",
"system",
"passcode",
"=",
"system",
"passcode",
";",
"}"
]
|
[
"return",
"the",
"configured",
"{",
"@",
"code",
"cache",
"}"
]
| [
"public",
"cache",
"get",
"cache",
"(",
")",
"{",
"return",
"this",
"cache",
";",
"}"
]
|
[
"creates",
"a",
"new",
"resource",
"by",
"p",
"u",
"tting",
"the",
"given",
"object",
"to",
"url",
"the",
"{",
"@",
"code",
"request",
"}",
"parameter",
"can",
"be",
"a",
"{",
"@",
"link",
"http",
"entity",
"}",
"in",
"order",
"to",
"add",
"additional",
"http",
"headers",
"to",
"the",
"request"
]
| [
"void",
"put",
"(",
"uri",
"url",
",",
"@",
"nullable",
"object",
"request",
")",
"throws",
"rest",
"client",
"exception",
";",
"/",
"/",
"patch"
]
|
[
"sets",
"the",
"entry",
"at",
"the",
"given",
"index"
]
| [
"public",
"void",
"set",
"(",
"int",
"n",
",",
"entry",
"entry",
")",
"{",
"set",
"0",
"(",
"n",
",",
"entry",
")",
";",
"}"
]
|
[
"configure",
"a",
"custom",
"{",
"@",
"link",
"web",
"session",
"manager",
"}",
"to",
"use",
"for",
"managing",
"web",
"sessions",
"the",
"provided",
"instance",
"is",
"set",
"on",
"each",
"created",
"{",
"@",
"link",
"default",
"server",
"web",
"exchange",
"}",
"by",
"default",
"this",
"is",
"set",
"to",
"{",
"@",
"link",
"default",
"web",
"session",
"manager",
"}"
]
| [
"public",
"void",
"set",
"session",
"manager",
"(",
"web",
"session",
"manager",
"session",
"manager",
")",
"{",
"assert",
"not",
"null",
"(",
"session",
"manager",
",",
"\"",
"web",
"session",
"manager",
"must",
"not",
"be",
"null",
"\"",
")",
";",
"this",
"session",
"manager",
"=",
"session",
"manager",
";",
"}"
]
|
[
"get",
"or",
"create",
"a",
"sensor",
"with",
"the",
"given",
"unique",
"name",
"and",
"no",
"parent",
"sensors",
"this",
"uses",
"a",
"default",
"recording",
"level",
"of",
"info"
]
| [
"public",
"sensor",
"sensor",
"(",
"string",
"name",
")",
"{",
"return",
"this",
"sensor",
"(",
"name",
",",
"sensor",
"recording",
"level",
"info",
")",
";",
"}"
]
|
[
"configures",
"the",
"format",
"to",
"either",
"allow",
"null",
"values",
"(",
"writing",
"an",
"empty",
"field",
")",
",",
"or",
"to",
"throw",
"an",
"exception",
"when",
"encountering",
"a",
"null",
"field",
"by",
"default",
",",
"null",
"values",
"are",
"allowed"
]
| [
"public",
"void",
"set",
"allow",
"null",
"values",
"(",
"boolean",
"allow",
"nulls",
")",
"{",
"this",
"allow",
"null",
"values",
"=",
"allow",
"nulls",
";",
"}"
]
|
[
"convert",
"the",
"given",
"object",
"to",
"string",
"with",
"each",
"line",
"indented",
"by",
"4",
"spaces",
"(",
"except",
"the",
"first",
"line",
")"
]
| [
"private",
"string",
"to",
"indented",
"string",
"(",
"object",
"o",
")",
"{",
"if",
"(",
"o",
"=",
"=",
"null",
")",
"{",
"return",
"\"",
"null",
"\"",
";",
"}",
"return",
"o",
"to",
"string",
"(",
")",
"replace",
"(",
"\"",
"\\",
"n",
"\"",
",",
"\"",
"\\",
"n",
"\"",
")",
";",
"}"
]
|
[
"returns",
"the",
"string",
"name",
"of",
"the",
"attribute"
]
| [
"public",
"string",
"get",
"attribute",
"name",
"(",
"clazz",
"clazz",
")",
"{",
"return",
"clazz",
"get",
"string",
"(",
"u",
"2attribute",
"name",
"index",
")",
";",
"}"
]
|
[
"get",
"date",
"time"
]
| [
"public",
"offset",
"date",
"time",
"get",
"date",
"time",
"(",
")",
"{",
"return",
"date",
"time",
";",
"}"
]
|
[
"find",
"the",
"jta",
"user",
"transaction",
"through",
"a",
"default",
"jndi",
"lookup",
":",
"\"",
"java",
":",
"comp",
"user",
"transaction",
"\""
]
| [
"protected",
"user",
"transaction",
"find",
"user",
"transaction",
"(",
")",
"{",
"string",
"jndi",
"name",
"=",
"default",
"user",
"transaction",
"name",
";",
"try",
"{",
"user",
"transaction",
"ut",
"=",
"get",
"jndi",
"template",
"(",
")",
"lookup",
"(",
"jndi",
"name",
",",
"user",
"transaction",
"class",
")",
";",
"if",
"(",
"logger",
"is",
"debug",
"enabled",
"(",
")",
")",
"{",
"logger",
"debug",
"(",
"\"",
"jta",
"user",
"transaction",
"found",
"at",
"default",
"jndi",
"location",
"[",
"\"",
"+",
"jndi",
"name",
"+",
"\"",
"]",
"\"",
")",
";",
"}",
"this",
"user",
"transaction",
"obtained",
"from",
"jndi",
"=",
"true",
";",
"return",
"ut",
";",
"}",
"catch",
"(",
"naming",
"exception",
"ex",
")",
"{",
"if",
"(",
"logger",
"is",
"debug",
"enabled",
"(",
")",
")",
"{",
"logger",
"debug",
"(",
"\"",
"no",
"jta",
"user",
"transaction",
"found",
"at",
"default",
"jndi",
"location",
"[",
"\"",
"+",
"jndi",
"name",
"+",
"\"",
"]",
"\"",
",",
"ex",
")",
";",
"}",
"return",
"null",
";",
"}",
"}"
]
|
[
"create",
"the",
"file",
"as",
"well",
"as",
"the",
"parent",
"directory"
]
| [
"public",
"static",
"boolean",
"create",
"file",
"(",
"final",
"path",
"file",
"path",
")",
"{",
"try",
"{",
"final",
"path",
"parent",
"=",
"file",
"path",
"get",
"parent",
"(",
")",
";",
"if",
"(",
"parent",
"=",
"=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"files",
"create",
"directories",
"(",
"parent",
")",
";",
"if",
"(",
"files",
"not",
"exists",
"(",
"file",
"path",
")",
")",
"{",
"files",
"create",
"file",
"(",
"file",
"path",
")",
";",
"}",
"return",
"true",
";",
"}",
"catch",
"(",
"final",
"exception",
"e",
")",
"{",
"return",
"false",
";",
"}",
"}"
]
|
[
"print",
"values",
"in",
"a",
"nice",
"format",
",",
"e",
"g",
"(",
"1",
",",
"2",
",",
"3",
")"
]
| [
"public",
"static",
"string",
"print",
"values",
"(",
"string",
"start",
",",
"string",
"separator",
",",
"string",
"end",
",",
"iterator",
"<",
"?",
">",
"values",
")",
"{",
"if",
"(",
"start",
"=",
"=",
"null",
")",
"{",
"start",
"=",
"\"",
"(",
"\"",
";",
"}",
"if",
"(",
"separator",
"=",
"=",
"null",
")",
"{",
"separator",
"=",
"\"",
",",
"\"",
";",
"}",
"if",
"(",
"end",
"=",
"=",
"null",
")",
"{",
"end",
"=",
"\"",
")",
"\"",
";",
"}",
"string",
"builder",
"sb",
"=",
"new",
"string",
"builder",
"(",
"start",
")",
";",
"while",
"(",
"values",
"has",
"next",
"(",
")",
")",
"{",
"sb",
"append",
"(",
"print",
"(",
"values",
"next",
"(",
")",
")",
")",
";",
"if",
"(",
"values",
"has",
"next",
"(",
")",
")",
"{",
"sb",
"append",
"(",
"separator",
")",
";",
"}",
"}",
"return",
"sb",
"append",
"(",
"end",
")",
"to",
"string",
"(",
")",
";",
"}"
]
|
[
"this",
"test",
"runs",
"a",
"job",
"reading",
"bounded",
"input",
"with",
"a",
"stream",
"record",
"format",
"(",
"text",
"lines",
")",
"and",
"restarts",
"task",
"manager"
]
| [
"public",
"void",
"test",
"bounded",
"text",
"file",
"source",
"with",
"task",
"manager",
"failover",
"(",
")",
"throws",
"exception",
"{",
"test",
"bounded",
"text",
"file",
"source",
"(",
"failover",
"type",
"tm",
")",
";",
"}"
]
|
[
"{",
"@",
"inherit",
"doc",
"}"
]
| [
"public",
"void",
"commit",
"(",
")",
"throws",
"s",
"q",
"l",
"exception",
"{",
"delegate",
"commit",
"(",
")",
";",
"is",
"commit",
"state",
"dirty",
"=",
"false",
";",
"last",
"access",
"=",
"current",
"time",
"(",
")",
";",
"}"
]
|
[
"returns",
"a",
"{",
"@",
"code",
"future",
"}",
"whose",
"result",
"is",
"taken",
"from",
"the",
"given",
"primary",
"{",
"@",
"code",
"input",
"}",
"or",
",",
"if",
"the",
"primary",
"input",
"fails",
"with",
"the",
"given",
"{",
"@",
"code",
"exception",
"type",
"}",
",",
"from",
"the",
"result",
"provided",
"by",
"the",
"{",
"@",
"code",
"fallback",
"}",
"{",
"@",
"link",
"function",
"#",
"apply",
"}",
"is",
"not",
"invoked",
"until",
"the",
"primary",
"input",
"has",
"failed",
",",
"so",
"if",
"the",
"primary",
"input",
"succeeds",
",",
"it",
"is",
"never",
"invoked",
"if",
",",
"during",
"the",
"invocation",
"of",
"{",
"@",
"code",
"fallback",
"}",
",",
"an",
"exception",
"is",
"thrown",
",",
"this",
"exception",
"is",
"used",
"as",
"the",
"result",
"of",
"the",
"output",
"{",
"@",
"code",
"future",
"}",
"usage",
"example",
":",
"{",
"@",
"code",
"listenable",
"future",
"<",
"integer",
">",
"fetch",
"counter",
"future",
"=",
";",
"falling",
"back",
"to",
"a",
"zero",
"counter",
"in",
"case",
"an",
"exception",
"happens",
"when",
"processing",
"the",
"rpc",
"to",
"fetch",
"counters",
"listenable",
"future",
"<",
"integer",
">",
"fault",
"tolerant",
"future",
"=",
"futures",
"catching",
"(",
"fetch",
"counter",
"future",
",",
"fetch",
"exception",
"class",
",",
"x",
"-",
">",
"0",
",",
"direct",
"executor",
"(",
")",
")",
";",
"}",
"when",
"selecting",
"an",
"executor",
",",
"note",
"that",
"{",
"@",
"code",
"direct",
"executor",
"}",
"is",
"dangerous",
"in",
"some",
"cases",
"see",
"the",
"warnings",
"the",
"{",
"@",
"link",
"more",
"executors",
"#",
"direct",
"executor",
"}",
"documentation"
]
| [
"public",
"static",
"<",
"v",
",",
"x",
"extends",
"throwable",
">",
"listenable",
"future",
"<",
"v",
">",
"catching",
"(",
"listenable",
"future",
"<",
"?",
"extends",
"v",
">",
"input",
",",
"class",
"<",
"x",
">",
"exception",
"type",
",",
"function",
"<",
"?",
"super",
"x",
",",
"?",
"extends",
"v",
">",
"fallback",
",",
"executor",
"executor",
")",
"{",
"return",
"abstract",
"catching",
"future",
"create",
"(",
"input",
",",
"exception",
"type",
",",
"fallback",
",",
"executor",
")",
";",
"}"
]
|
[
"returns",
"the",
"checkpointing",
"interval",
"or",
"-",
"1",
"if",
"checkpointing",
"is",
"disabled",
"shorthand",
"for",
"{",
"@",
"code",
"get",
"checkpoint",
"config",
"(",
")",
"get",
"checkpoint",
"interval",
"(",
")",
"}"
]
| [
"public",
"long",
"get",
"checkpoint",
"interval",
"(",
")",
"{",
"return",
"checkpoint",
"cfg",
"get",
"checkpoint",
"interval",
"(",
")",
";",
"}"
]
|
[
"returns",
"any",
"nested",
"exceptions",
"included",
"in",
"this",
"exception"
]
| [
"public",
"throwable",
"get",
"nested",
"exception",
"(",
")",
"{",
"return",
"(",
"throwable",
")",
";",
"}"
]
|
[
"@",
"t",
"c",
"description",
":",
",",
"。",
"@",
"test",
"step",
":",
"@",
"expect",
"result",
":"
]
| [
"public",
"void",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"(",
")",
"throws",
"exception",
"{",
"http",
"headers",
"headers",
"=",
"new",
"http",
"headers",
"(",
")",
";",
"/",
"/",
"final",
"string",
"data",
"id",
"=",
"\"",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"\"",
";",
"final",
"string",
"group",
"id",
"=",
"\"",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"\"",
";",
"final",
"string",
"content",
"=",
"\"",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"\"",
";",
"response",
"entity",
"<",
"string",
">",
"response",
"=",
"request",
"(",
"config",
"controller",
"path",
"+",
"\"",
"/",
"configs",
"\"",
",",
"headers",
",",
"params",
"new",
"params",
"(",
")",
"append",
"param",
"(",
"\"",
"data",
"id",
"\"",
",",
"data",
"id",
")",
"append",
"param",
"(",
"\"",
"group",
"\"",
",",
"group",
"id",
")",
"append",
"param",
"(",
"\"",
"tenant",
"\"",
",",
"tenant",
")",
"append",
"param",
"(",
"\"",
"content",
"\"",
",",
"content",
")",
"append",
"param",
"(",
"\"",
"config",
"tags",
"\"",
",",
"\"",
"\"",
")",
"append",
"param",
"(",
"\"",
"app",
"name",
"\"",
",",
"app",
"name",
")",
"done",
"(",
")",
",",
"string",
"class",
",",
"http",
"method",
"post",
")",
";",
"system",
"out",
"println",
"(",
"\"",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"post",
":",
"\"",
"+",
"response",
")",
";",
"assert",
"assert",
"true",
"(",
"response",
"get",
"status",
"code",
"(",
")",
"is",
"2xx",
"successful",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"\"",
"true",
"\"",
",",
"response",
"get",
"body",
"(",
")",
")",
";",
"thread",
"utils",
"sleep",
"(",
"10",
"000l",
")",
";",
"response",
"=",
"request",
"(",
"config",
"controller",
"path",
"+",
"\"",
"/",
"configs",
"?",
"beta",
"=",
"false",
"\"",
",",
"params",
"new",
"params",
"(",
")",
"append",
"param",
"(",
"\"",
"data",
"id",
"\"",
",",
"data",
"id",
")",
"append",
"param",
"(",
"\"",
"group",
"\"",
",",
"group",
"id",
")",
"append",
"param",
"(",
"\"",
"tenant",
"\"",
",",
"tenant",
")",
"done",
"(",
")",
",",
"string",
"class",
",",
"http",
"method",
"get",
")",
";",
"system",
"out",
"println",
"(",
"\"",
"publish",
"beta",
"config",
"no",
"beta",
"ips",
"get",
":",
"\"",
"+",
"response",
")",
";",
"assert",
"assert",
"true",
"(",
"response",
"get",
"status",
"code",
"(",
")",
"is",
"2xx",
"successful",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"content",
",",
"response",
"get",
"body",
"(",
")",
")",
";",
"}"
]
|
[
"register",
"a",
"listener",
"that",
"will",
"be",
"called",
"when",
"this",
"model",
"is",
"unbound",
"from",
"a",
"view",
"the",
"listener",
"will",
"contribute",
"to",
"this",
"model",
"'",
"s",
"hash",
"code",
"state",
"per",
"the",
"{",
"@",
"link",
"com",
"airbnb",
"epoxy",
"epoxy",
"attribute",
"option",
"#",
"do",
"not",
"hash",
"}",
"rules",
"you",
"may",
"clear",
"the",
"listener",
"by",
"setting",
"a",
"null",
"value",
",",
"or",
"by",
"calling",
"{",
"@",
"link",
"#",
"reset",
"(",
")",
"}"
]
| [
"public",
"null",
"on",
"recycle",
"view",
"model",
"on",
"unbind",
"(",
"on",
"model",
"unbound",
"listener",
"<",
"null",
"on",
"recycle",
"view",
"model",
",",
"null",
"on",
"recycle",
"view",
">",
"listener",
")",
"{",
"on",
"mutation",
"(",
")",
";",
"this",
"on",
"model",
"unbound",
"listener",
"epoxy",
"generated",
"model",
"=",
"listener",
";",
"return",
"this",
";",
"}"
]
|
[
"returns",
"whether",
"this",
"data",
"entry",
"is",
"a",
"zip",
"file"
]
| [
"public",
"boolean",
"is",
"zip",
"(",
")",
"{",
"return",
"has",
"extension",
"(",
"\"",
"zip",
"\"",
")",
";",
"}"
]
|
[
"merge",
"all",
"children",
"nodes",
"to",
"appoint",
"node"
]
| [
"private",
"void",
"combine",
"children",
"nodes",
"(",
"profile",
"stack",
"node",
"target",
"node",
",",
"profile",
"stack",
"node",
"being",
"merged",
"node",
",",
"consumer",
"<",
"pair",
"<",
"profile",
"stack",
"node",
",",
"profile",
"stack",
"node",
">",
">",
"continue",
"children",
"merging",
")",
"{",
"if",
"(",
"being",
"merged",
"node",
"children",
"is",
"empty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"profile",
"stack",
"node",
"children",
"node",
":",
"target",
"node",
"children",
")",
"{",
"/",
"/",
"find",
"node",
"from",
"being",
"merged",
"node",
"children",
"for",
"(",
"list",
"iterator",
"<",
"profile",
"stack",
"node",
">",
"it",
"=",
"being",
"merged",
"node",
"children",
"list",
"iterator",
"(",
")",
";",
"it",
"has",
"next",
"(",
")",
";",
")",
"{",
"profile",
"stack",
"node",
"node",
"=",
"it",
"next",
"(",
")",
";",
"if",
"(",
"node",
"!",
"=",
"null",
"&",
"&",
"node",
"matches",
"(",
"children",
"node",
")",
")",
"{",
"children",
"node",
"combine",
"detected",
"stacks",
"(",
"node",
")",
";",
"continue",
"children",
"merging",
"accept",
"(",
"new",
"pair",
"<",
">",
"(",
"children",
"node",
",",
"node",
")",
")",
";",
"it",
"set",
"(",
"null",
")",
";",
"break",
";",
"}",
"}",
"}",
"for",
"(",
"profile",
"stack",
"node",
"node",
":",
"being",
"merged",
"node",
"children",
")",
"{",
"if",
"(",
"node",
"!",
"=",
"null",
")",
"{",
"target",
"node",
"children",
"add",
"(",
"node",
")",
";",
"}",
"}",
"}"
]
|
[
"assert",
"a",
"boolean",
"expression",
",",
"throwing",
"{",
"@",
"code",
"illegal",
"argument",
"exception",
"}",
"if",
"the",
"test",
"result",
"is",
"{",
"@",
"code",
"false",
"}",
"<",
"pre",
"class",
"=",
"\"",
"code",
"\"",
">",
"assert",
"is",
"true",
"(",
"i",
"&",
"gt",
";",
"0",
",",
"\"",
"the",
"value",
"must",
"be",
"greater",
"than",
"zero",
"\"",
")",
";"
]
| [
"public",
"static",
"void",
"is",
"true",
"(",
"boolean",
"expression",
",",
"string",
"message",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"illegal",
"argument",
"exception",
"(",
"message",
")",
";",
"}",
"}"
]
|
[
"convert",
"the",
"given",
"object",
"to",
"string",
"with",
"each",
"line",
"indented",
"by",
"4",
"spaces",
"(",
"except",
"the",
"first",
"line",
")"
]
| [
"private",
"string",
"to",
"indented",
"string",
"(",
"object",
"o",
")",
"{",
"if",
"(",
"o",
"=",
"=",
"null",
")",
"{",
"return",
"\"",
"null",
"\"",
";",
"}",
"return",
"o",
"to",
"string",
"(",
")",
"replace",
"(",
"\"",
"\\",
"n",
"\"",
",",
"\"",
"\\",
"n",
"\"",
")",
";",
"}"
]
|
[
"deserializes",
"name",
"table",
"streams",
"an",
"offset",
"-",
"to",
"-",
"string",
"map",
"is",
"created",
"for",
"each",
"stream",
";",
"each",
"map",
"is",
"placed",
"into",
"a",
"stream",
"-",
"number",
"-",
"to",
"-",
"map",
"map"
]
| [
"void",
"deserialize",
"name",
"table",
"streams",
"(",
"task",
"monitor",
"monitor",
")",
"throws",
"i",
"o",
"exception",
",",
"pdb",
"exception",
",",
"cancelled",
"exception",
"{",
"for",
"(",
"int",
"stream",
"number",
":",
"stream",
"numbers",
")",
"{",
"monitor",
"check",
"canceled",
"(",
")",
";",
"map",
"<",
"integer",
",",
"string",
">",
"strings",
"by",
"offset",
"=",
"new",
"hash",
"map",
"<",
">",
"(",
")",
";",
"pdb",
"byte",
"reader",
"reader",
"=",
"pdb",
"get",
"reader",
"for",
"stream",
"number",
"(",
"stream",
"number",
",",
"monitor",
")",
";",
"if",
"(",
"reader",
"get",
"limit",
"(",
")",
">",
"=",
"12",
")",
"{",
"long",
"hdr",
"magic",
"=",
"reader",
"parse",
"unsigned",
"int",
"val",
"(",
")",
";",
"int",
"hdr",
"ver",
"=",
"reader",
"parse",
"int",
"(",
")",
";",
"if",
"(",
"(",
"hdr",
"magic",
"=",
"=",
"header",
"magic",
")",
"&",
"&",
"(",
"hdr",
"ver",
"!",
"=",
"0",
")",
")",
"{",
"switch",
"(",
"hdr",
"ver",
")",
"{",
"case",
"1",
":",
"/",
"/",
"we",
"know",
"this",
"works",
"ver",
"hdr",
"ver",
"=",
"=",
"1",
"int",
"length",
"=",
"reader",
"parse",
"int",
"(",
")",
";",
"pdb",
"byte",
"reader",
"string",
"reader",
"=",
"reader",
"get",
"sub",
"pdb",
"byte",
"reader",
"(",
"length",
")",
";",
"while",
"(",
"string",
"reader",
"has",
"more",
"(",
")",
")",
"{",
"monitor",
"check",
"canceled",
"(",
")",
";",
"int",
"offset",
"=",
"string",
"reader",
"get",
"index",
"(",
")",
";",
"string",
"string",
"=",
"string",
"reader",
"parse",
"null",
"terminated",
"utf",
"8",
"string",
"(",
")",
";",
"strings",
"by",
"offset",
"put",
"(",
"offset",
",",
"string",
")",
";",
"}",
"/",
"/",
"todo",
":",
"?",
"process",
"the",
"rest",
"of",
"the",
"data",
"in",
"reader",
"?",
"break",
";",
"case",
"2",
":",
"default",
":",
"/",
"/",
"todo",
":",
"unknown",
"format",
"break",
";",
"}",
"}",
"else",
"{",
"/",
"/",
"back",
"up",
"for",
"nonexistent",
"hdr",
"magic",
"and",
"hdr",
"ver",
"reader",
"set",
"index",
"(",
"reader",
"get",
"index",
"(",
")",
"-",
"8",
")",
";",
"/",
"/",
"todo",
":",
"unknown",
"format",
"}",
"}",
"string",
"tables",
"by",
"stream",
"number",
"put",
"(",
"stream",
"number",
",",
"strings",
"by",
"offset",
")",
";",
"}",
"int",
"names",
"stream",
"number",
"=",
"get",
"stream",
"number",
"from",
"name",
"(",
"\"",
"/",
"names",
"\"",
")",
";",
"names",
"by",
"offset",
"=",
"string",
"tables",
"by",
"stream",
"number",
"get",
"(",
"names",
"stream",
"number",
")",
";",
"}"
]
|
[
"remove",
"each",
"element",
"in",
"an",
"iterable",
"from",
"a",
"set"
]
| [
"static",
"boolean",
"remove",
"all",
"impl",
"(",
"set",
"<",
"?",
">",
"set",
",",
"iterator",
"<",
"?",
">",
"iterator",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"while",
"(",
"iterator",
"has",
"next",
"(",
")",
")",
"{",
"changed",
"|",
"=",
"set",
"remove",
"(",
"iterator",
"next",
"(",
")",
")",
";",
"}",
"return",
"changed",
";",
"}"
]
|
[
"performs",
"the",
"pre",
"-",
"closing",
"checks",
"on",
"the",
"{",
"@",
"link",
"index",
"shard",
"}"
]
| [
"public",
"void",
"verify",
"shard",
"before",
"index",
"closing",
"(",
")",
"throws",
"illegal",
"state",
"exception",
"{",
"get",
"engine",
"(",
")",
"verify",
"engine",
"before",
"index",
"closing",
"(",
")",
";",
"}"
]
|
[
"returns",
"{",
"@",
"code",
"true",
"}",
"if",
"its",
"a",
"root",
"server"
]
| [
"boolean",
"is",
"root",
"server",
"(",
")",
"{",
"return",
"dots",
"=",
"=",
"1",
";",
"}"
]
|
[
"test",
"snapshot",
"after",
"file",
"appending"
]
| [
"public",
"void",
"test",
"snapshot",
"after",
"appending",
"(",
")",
"throws",
"exception",
"{",
"path",
"file",
"=",
"new",
"path",
"(",
"dir",
",",
"\"",
"file",
"\"",
")",
";",
"/",
"/",
"1",
"create",
"snapshot",
"-",
"-",
">",
"create",
"file",
"-",
"-",
">",
"append",
"snapshot",
"test",
"helper",
"create",
"snapshot",
"(",
"hdfs",
",",
"dir",
",",
"\"",
"s",
"0",
"\"",
")",
";",
"d",
"f",
"s",
"test",
"util",
"create",
"file",
"(",
"hdfs",
",",
"file",
",",
"blocksize",
",",
"replication",
",",
"seed",
")",
";",
"d",
"f",
"s",
"test",
"util",
"append",
"file",
"(",
"hdfs",
",",
"file",
",",
"blocksize",
")",
";",
"i",
"node",
"file",
"file",
"node",
"=",
"(",
"i",
"node",
"file",
")",
"fsdir",
"get",
"i",
"node",
"(",
"file",
"to",
"string",
"(",
")",
")",
";",
"/",
"/",
"2",
"create",
"snapshot",
"-",
"-",
">",
"modify",
"the",
"file",
"-",
"-",
">",
"append",
"hdfs",
"create",
"snapshot",
"(",
"dir",
",",
"\"",
"s",
"1",
"\"",
")",
";",
"hdfs",
"set",
"replication",
"(",
"file",
",",
"(",
"short",
")",
"(",
"replication",
"-",
"1",
")",
")",
";",
"d",
"f",
"s",
"test",
"util",
"append",
"file",
"(",
"hdfs",
",",
"file",
",",
"blocksize",
")",
";",
"/",
"/",
"check",
"corresponding",
"inodes",
"file",
"node",
"=",
"(",
"i",
"node",
"file",
")",
"fsdir",
"get",
"i",
"node",
"(",
"file",
"to",
"string",
"(",
")",
")",
";",
"assert",
"equals",
"(",
"replication",
"-",
"1",
",",
"file",
"node",
"get",
"file",
"replication",
"(",
")",
")",
";",
"assert",
"equals",
"(",
"blocksize",
"*",
"3",
",",
"file",
"node",
"compute",
"file",
"size",
"(",
")",
")",
";",
"/",
"/",
"3",
"create",
"snapshot",
"-",
"-",
">",
"append",
"hdfs",
"create",
"snapshot",
"(",
"dir",
",",
"\"",
"s",
"2",
"\"",
")",
";",
"d",
"f",
"s",
"test",
"util",
"append",
"file",
"(",
"hdfs",
",",
"file",
",",
"blocksize",
")",
";",
"/",
"/",
"check",
"corresponding",
"inodes",
"file",
"node",
"=",
"(",
"i",
"node",
"file",
")",
"fsdir",
"get",
"i",
"node",
"(",
"file",
"to",
"string",
"(",
")",
")",
";",
"assert",
"equals",
"(",
"replication",
"-",
"1",
",",
"file",
"node",
"get",
"file",
"replication",
"(",
")",
")",
";",
"assert",
"equals",
"(",
"blocksize",
"*",
"4",
",",
"file",
"node",
"compute",
"file",
"size",
"(",
")",
")",
";",
"}"
]
|
[
"verify",
"that",
"the",
"cause",
"of",
"an",
"exception",
"is",
"of",
"the",
"given",
"type"
]
| [
"public",
"static",
"<",
"e",
"extends",
"throwable",
">",
"e",
"verify",
"cause",
"(",
"class",
"<",
"e",
">",
"clazz",
",",
"final",
"throwable",
"caught",
")",
"throws",
"throwable",
"{",
"throwable",
"cause",
"=",
"caught",
"get",
"cause",
"(",
")",
";",
"if",
"(",
"cause",
"=",
"=",
"null",
"|",
"|",
"!",
"clazz",
"is",
"assignable",
"from",
"(",
"cause",
"get",
"class",
"(",
")",
")",
")",
"{",
"throw",
"caught",
";",
"}",
"else",
"{",
"return",
"(",
"e",
")",
"caught",
";",
"}",
"}"
]
|
[
"set",
"the",
"changed",
"bit",
"checked",
"via",
"{",
"@",
"link",
"#",
"is",
"state",
"changed",
"(",
")",
"}",
"to",
"{",
"@",
"code",
"true",
"}"
]
| [
"public",
"void",
"set",
"state",
"changed",
"(",
")",
"{",
"this",
"state",
"changed",
"=",
"true",
";",
"}"
]
|
[
"convert",
"the",
"given",
"object",
"to",
"string",
"with",
"each",
"line",
"indented",
"by",
"4",
"spaces",
"(",
"except",
"the",
"first",
"line",
")"
]
| [
"private",
"string",
"to",
"indented",
"string",
"(",
"java",
"lang",
"object",
"o",
")",
"{",
"if",
"(",
"o",
"=",
"=",
"null",
")",
"{",
"return",
"\"",
"null",
"\"",
";",
"}",
"return",
"o",
"to",
"string",
"(",
")",
"replace",
"(",
"\"",
"\\",
"n",
"\"",
",",
"\"",
"\\",
"n",
"\"",
")",
";",
"}"
]
|
[
"gets",
"the",
"name",
"of",
"the",
"host",
"where",
"the",
"attempt",
"ran"
]
| [
"public",
"string",
"get",
"hostname",
"(",
")",
"{",
"return",
"hostname",
"to",
"string",
"(",
")",
";",
"}"
]
|
[
"does",
"the",
"value",
"match",
"this",
"query",
"?"
]
| [
"protected",
"abstract",
"boolean",
"matches",
"(",
"list",
"<",
"string",
">",
"values",
")",
";"
]
|
[
"<",
"code",
">",
"optional",
"string",
"value",
"=",
"1",
";",
"<",
"code",
">"
]
| [
"public",
"builder",
"set",
"value",
"bytes",
"(",
"com",
"google",
"protobuf",
"byte",
"string",
"value",
")",
"{",
"copy",
"on",
"write",
"(",
")",
";",
"instance",
"set",
"value",
"bytes",
"(",
"value",
")",
";",
"return",
"this",
";",
"}"
]
|
[
"called",
"when",
"the",
"user",
"clicks",
"through",
"an",
"ad",
"(",
"for",
"example",
",",
"following",
"a",
"'",
"learn",
"more",
"'",
"link",
")"
]
| [
"default",
"void",
"on",
"ad",
"clicked",
"(",
")",
"{",
"}"
]
|
[
"<",
"code",
">",
"optional",
"second",
"msg",
"blah",
"=",
"2",
";",
"<",
"code",
">"
]
| [
"private",
"com",
"google",
"protobuf",
"single",
"field",
"builder",
"<",
"second",
"msg",
",",
"second",
"msg",
"builder",
",",
"second",
"msg",
"or",
"builder",
">",
"get",
"blah",
"field",
"builder",
"(",
")",
"{",
"if",
"(",
"blah",
"builder",
"=",
"=",
"null",
")",
"{",
"blah",
"builder",
"=",
"new",
"com",
"google",
"protobuf",
"single",
"field",
"builder",
"<",
">",
"(",
"blah",
",",
"get",
"parent",
"for",
"children",
"(",
")",
",",
"is",
"clean",
"(",
")",
")",
";",
"blah",
"=",
"null",
";",
"}",
"return",
"blah",
"builder",
";",
"}"
]
|
[
"permit",
"(",
")",
"method",
"is",
"invoked",
"for",
"each",
"incoming",
"thrift",
"request"
]
| [
"public",
"boolean",
"permit",
"(",
"req",
"context",
"context",
",",
"string",
"operation",
",",
"map",
"topology",
"conf",
")",
";"
]
|
[
"returns",
"current",
"value",
"of",
"the",
"specified",
"counter",
",",
"or",
"0",
"if",
"the",
"counter",
"does",
"not",
"exist"
]
| [
"public",
"synchronized",
"long",
"get",
"counter",
"(",
"enum",
"<",
"?",
">",
"key",
")",
"{",
"return",
"find",
"counter",
"(",
"key",
")",
"get",
"value",
"(",
")",
";",
"}"
]
|
[
"begins",
"the",
"creation",
"of",
"a",
"job",
"chain",
"with",
"a",
"set",
"of",
"jobs",
"that",
"can",
"be",
"run",
"in",
"parallel"
]
| [
"public",
"chain",
"start",
"chain",
"(",
"@",
"non",
"null",
"list",
"<",
"?",
"extends",
"job",
">",
"jobs",
")",
"{",
"return",
"new",
"chain",
"(",
"this",
",",
"jobs",
")",
";",
"}"
]
|
[
"returns",
"required",
"normalization",
"level",
",",
"passed",
"to",
"{",
"@",
"link",
"#",
"normalize",
"}"
]
| [
"int",
"needs",
"to",
"normalize",
"(",
"string",
"path",
")",
";"
]
|
[
"moves",
"by",
"the",
"specified",
"amount",
"of",
"units",
"along",
"the",
"x",
"axis"
]
| [
"public",
"void",
"translate",
"x",
"(",
"float",
"units",
")",
"{",
"this",
"position",
"x",
"+",
"=",
"units",
";",
"updated",
"=",
"false",
";",
"}"
]
|
[
"add",
"cookies",
"to",
"the",
"request",
"that",
"is",
"being",
"built"
]
| [
"protected",
"void",
"add",
"cookies",
"to",
"request",
"(",
"multi",
"value",
"map",
"<",
"string",
",",
"string",
">",
"cookies",
",",
"body",
"builder",
"request",
"builder",
")",
"{",
"if",
"(",
"!",
"cookies",
"is",
"empty",
"(",
")",
")",
"{",
"request",
"builder",
"header",
"(",
"\"",
"cookie",
"\"",
",",
"build",
"cookie",
"header",
"(",
"cookies",
")",
")",
";",
"}",
"}"
]
|
[
"this",
"resource",
"response",
"is",
"an",
"incremental",
"update",
"the",
"source",
"should",
"only",
"send",
"incremental",
"updates",
"if",
"the",
"sink",
"requested",
"them",
"<",
"code",
">",
"bool",
"incremental",
"=",
"6",
";",
"<",
"code",
">"
]
| [
"public",
"builder",
"clear",
"incremental",
"(",
")",
"{",
"incremental",
"=",
"false",
";",
"on",
"changed",
"(",
")",
";",
"return",
"this",
";",
"}"
]
|
[
"convert",
"a",
"nanosecond",
"timestamp",
"in",
"milliseconds"
]
| [
"public",
"static",
"long",
"to",
"milli",
"seconds",
"(",
"long",
"nano",
"seconds",
"since",
"epoch",
")",
"{",
"if",
"(",
"nano",
"seconds",
"since",
"epoch",
"<",
"0",
")",
"{",
"throw",
"new",
"illegal",
"argument",
"exception",
"(",
"\"",
"nanoseconds",
"are",
"[",
"\"",
"+",
"nano",
"seconds",
"since",
"epoch",
"+",
"\"",
"]",
"are",
"before",
"the",
"epoch",
"in",
"1970",
"and",
"cannot",
"\"",
"+",
"\"",
"be",
"converted",
"to",
"milliseconds",
"\"",
")",
";",
"}",
"if",
"(",
"nano",
"seconds",
"since",
"epoch",
"=",
"=",
"0",
")",
"{",
"return",
"0",
";",
"}",
"return",
"nano",
"seconds",
"since",
"epoch",
"/",
"1",
"000",
"000",
";",
"}"
]
|
[
"this",
"method",
"can",
"be",
"overridden",
"to",
"add",
"a",
"(",
"non",
"-",
"blocking",
")",
"state",
"clearing",
"routine",
"to",
"the",
"resource",
"manager",
"that",
"will",
"be",
"called",
"when",
"leadership",
"is",
"revoked"
]
| [
"default",
"completable",
"future",
"<",
"void",
">",
"on",
"revoke",
"leadership",
"(",
")",
"{",
"return",
"future",
"utils",
"completed",
"void",
"future",
"(",
")",
";",
"}"
]
|
[
"<",
"code",
">",
"repeated",
"org",
"apache",
"dubbo",
"common",
"serialize",
"protobuf",
"model",
"phone",
"number",
"phone",
"=",
"8",
";",
"<",
"code",
">"
]
| [
"public",
"java",
"util",
"list",
"<",
"?",
"extends",
"phone",
"number",
"or",
"builder",
">",
"get",
"phone",
"or",
"builder",
"list",
"(",
")",
"{",
"return",
"phone",
";",
"}"
]
|
[
"creates",
"an",
"provider",
"from",
"the",
"resources",
"in",
"the",
"resource",
"apk",
"if",
"the",
"resource",
"apk",
"was",
"created",
"from",
"transitive",
"resources",
",",
"the",
"provider",
"will",
"effectively",
"contain",
"the",
"\"",
"forwarded",
"\"",
"resources",
":",
"the",
"merged",
"transitive",
"and",
"merged",
"direct",
"dependencies",
"of",
"this",
"library",
"if",
"the",
"resource",
"apk",
"was",
"generated",
"from",
"local",
"resources",
",",
"that",
"will",
"be",
"the",
"direct",
"dependencies",
"and",
"the",
"rest",
"will",
"be",
"transitive"
]
| [
"android",
"resources",
"info",
"to",
"resource",
"info",
"(",
"label",
"label",
")",
"{",
"if",
"(",
"validated",
"resources",
"=",
"=",
"null",
")",
"{",
"return",
"resource",
"deps",
"to",
"info",
"(",
"label",
",",
"manifest",
",",
"r",
"txt",
")",
";",
"}",
"return",
"resource",
"deps",
"to",
"info",
"(",
"validated",
"resources",
")",
";",
"}"
]
|
[
"add",
"recovering",
"block",
"to",
"the",
"command"
]
| [
"public",
"void",
"add",
"(",
"recovering",
"block",
"block",
")",
"{",
"recovering",
"blocks",
"add",
"(",
"block",
")",
";",
"}"
]
|
[
"returns",
"the",
"null",
"check",
"if",
"enabled",
",",
"all",
"fields",
"need",
"to",
"be",
"checked",
"for",
"null",
"first"
]
| [
"public",
"boolean",
"get",
"null",
"check",
"(",
")",
"{",
"return",
"null",
"check",
";",
"}"
]
|
[
"creates",
"a",
"new",
"short",
"buffer",
"by",
"wrapping",
"the",
"given",
"short",
"array",
"the",
"new",
"buffer",
"'",
"s",
"position",
"will",
"be",
"{",
"@",
"code",
"start",
"}",
",",
"limit",
"will",
"be",
"{",
"@",
"code",
"start",
"+",
"len",
"}",
",",
"capacity",
"will",
"be",
"the",
"length",
"of",
"the",
"array"
]
| [
"public",
"static",
"short",
"buffer",
"wrap",
"(",
"short",
"[",
"]",
"array",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"if",
"(",
"array",
"=",
"=",
"null",
")",
"{",
"throw",
"new",
"null",
"pointer",
"exception",
"(",
")",
";",
"}",
"if",
"(",
"start",
"<",
"0",
"|",
"|",
"len",
"<",
"0",
"|",
"|",
"(",
"long",
")",
"start",
"+",
"(",
"long",
")",
"len",
">",
"array",
"length",
")",
"{",
"throw",
"new",
"index",
"out",
"of",
"bounds",
"exception",
"(",
")",
";",
"}",
"short",
"buffer",
"buf",
"=",
"buffer",
"factory",
"new",
"short",
"buffer",
"(",
"array",
")",
";",
"buf",
"position",
"=",
"start",
";",
"buf",
"limit",
"=",
"start",
"+",
"len",
";",
"return",
"buf",
";",
"}"
]
|
[
"returns",
"an",
"index",
"that",
"will",
"always",
"be",
"associated",
"to",
"the",
"given",
"key",
"as",
"long",
"as",
"the",
"key",
"remains",
"in",
"the",
"table",
"if",
"the",
"key",
"already",
"exists",
",",
"then",
"the",
"index",
"where",
"that",
"key",
"is",
"stored",
"is",
"returned",
"if",
"the",
"key",
"is",
"new",
",",
"then",
"a",
"new",
"index",
"is",
"allocated",
",",
"the",
"key",
"is",
"stored",
"at",
"that",
"index",
",",
"and",
"the",
"new",
"index",
"is",
"returned"
]
| [
"public",
"int",
"put",
"(",
"t",
"key",
")",
"{",
"/",
"/",
"check",
"if",
"the",
"key",
"already",
"exists",
"int",
"index",
"=",
"find",
"key",
"(",
"key",
")",
";",
"/",
"/",
"if",
"not",
",",
"then",
"we",
"need",
"to",
"add",
"it",
"if",
"(",
"index",
"=",
"=",
"-",
"1",
")",
"{",
"/",
"/",
"make",
"sure",
"there",
"is",
"enough",
"room",
"if",
"(",
"indexer",
"get",
"size",
"(",
")",
">",
"=",
"capacity",
")",
"{",
"/",
"/",
"if",
"not",
"enough",
"room",
",",
"grow",
"the",
"key",
"capacity",
"grow",
"(",
")",
";",
"}",
"/",
"/",
"now",
"use",
"the",
"hashcode",
"as",
"the",
"list",
"i",
"d",
"and",
"get",
"a",
"new",
"index",
"/",
"/",
"to",
"put",
"on",
"that",
"list",
"then",
"store",
"the",
"key",
"at",
"the",
"new",
"index",
"int",
"hashcode",
"=",
"(",
"key",
"hash",
"code",
"(",
")",
"&",
"0x",
"7",
"f",
"f",
"f",
"f",
"f",
"f",
"f",
")",
"%",
"capacity",
";",
"index",
"=",
"indexer",
"add",
"(",
"hashcode",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"throw",
"new",
"index",
"out",
"of",
"bounds",
"exception",
"(",
"\"",
"maximum",
"capacity",
"reached",
"\"",
")",
";",
"}",
"keys",
"[",
"index",
"]",
"=",
"key",
";",
"}",
"/",
"/",
"return",
"the",
"index",
"associated",
"with",
"the",
"given",
"key",
"return",
"index",
";",
"}"
]
|
[
"cleans",
"up",
"a",
"single",
"reference",
"catches",
"and",
"logs",
"all",
"throwables"
]
| [
"private",
"boolean",
"clean",
"up",
"(",
"reference",
"<",
"?",
">",
"reference",
")",
"{",
"method",
"finalize",
"referent",
"method",
"=",
"get",
"finalize",
"referent",
"method",
"(",
")",
";",
"if",
"(",
"finalize",
"referent",
"method",
"=",
"=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"do",
"{",
"/",
"*",
"*",
"this",
"is",
"for",
"the",
"benefit",
"of",
"phantom",
"references",
"weak",
"and",
"soft",
"references",
"will",
"have",
"already",
"*",
"been",
"cleared",
"by",
"this",
"point",
"*",
"/",
"reference",
"clear",
"(",
")",
";",
"if",
"(",
"reference",
"=",
"=",
"frq",
"reference",
")",
"{",
"/",
"*",
"*",
"the",
"client",
"no",
"longer",
"has",
"a",
"reference",
"to",
"the",
"finalizable",
"reference",
"queue",
"we",
"can",
"stop",
"*",
"/",
"return",
"false",
";",
"}",
"try",
"{",
"finalize",
"referent",
"method",
"invoke",
"(",
"reference",
")",
";",
"}",
"catch",
"(",
"throwable",
"t",
")",
"{",
"logger",
"log",
"(",
"level",
"severe",
",",
"\"",
"error",
"cleaning",
"up",
"after",
"reference",
"\"",
",",
"t",
")",
";",
"}",
"/",
"*",
"*",
"loop",
"as",
"long",
"as",
"we",
"have",
"references",
"available",
"so",
"as",
"not",
"to",
"waste",
"cpu",
"looking",
"up",
"the",
"method",
"*",
"over",
"and",
"over",
"again",
"*",
"/",
"}",
"while",
"(",
"(",
"reference",
"=",
"queue",
"poll",
"(",
")",
")",
"!",
"=",
"null",
")",
";",
"return",
"true",
";",
"}"
]
|
[
"sets",
"whether",
"or",
"not",
"this",
"action",
"should",
"be",
"activated",
"using",
"the",
"default",
"tool",
"context",
"if",
"the",
"current",
"focused",
"provider",
"'",
"s",
"context",
"is",
"not",
"valid",
"for",
"this",
"action",
"typically",
",",
"this",
"should",
"be",
"set",
"on",
"actions",
"that",
"are",
"mostly",
"independent",
"of",
"which",
"component",
"has",
"focus",
"such",
"as",
"those",
"on",
"the",
"tool",
"'",
"s",
"main",
"toolbar"
]
| [
"public",
"void",
"set",
"supports",
"default",
"tool",
"context",
"(",
"boolean",
"new",
"value",
")",
";"
]
|
[
"delete",
"purchase",
"order",
"by",
"id",
"for",
"valid",
"response",
"try",
"integer",
"i",
"ds",
"with",
"value",
"&",
"lt",
";",
"1000",
"anything",
"above",
"1000",
"or",
"nonintegers",
"will",
"generate",
"api",
"errors",
"<",
"b",
">",
"400",
"<",
"b",
">",
"-",
"invalid",
"id",
"supplied",
"<",
"b",
">",
"404",
"<",
"b",
">",
"-",
"order",
"not",
"found"
]
| [
"public",
"void",
"delete",
"order",
"(",
"string",
"order",
"id",
")",
"throws",
"rest",
"client",
"exception",
"{",
"delete",
"order",
"with",
"http",
"info",
"(",
"order",
"id",
")",
";",
"}"
]
|
[
"sets",
"whether",
"the",
"query",
"builder",
"should",
"ignore",
"unmapped",
"fields",
"(",
"and",
"run",
"a",
"{",
"@",
"link",
"match",
"no",
"docs",
"query",
"}",
"in",
"place",
"of",
"this",
"query",
")",
"or",
"throw",
"an",
"exception",
"if",
"the",
"field",
"is",
"unmapped"
]
| [
"public",
"geo",
"bounding",
"box",
"query",
"builder",
"ignore",
"unmapped",
"(",
"boolean",
"ignore",
"unmapped",
")",
"{",
"this",
"ignore",
"unmapped",
"=",
"ignore",
"unmapped",
";",
"return",
"this",
";",
"}"
]
|
[
"enable",
"indenting",
"for",
"the",
"supplied",
"{",
"@",
"link",
"javax",
"xml",
"transform",
"transformer",
"}",
"if",
"the",
"underlying",
"xslt",
"engine",
"is",
"xalan",
",",
"then",
"the",
"special",
"output",
"key",
"{",
"@",
"code",
"indent",
"-",
"amount",
"}",
"will",
"be",
"also",
"be",
"set",
"to",
"a",
"value",
"of",
"{",
"@",
"link",
"#",
"default",
"indent",
"amount",
"}",
"characters"
]
| [
"public",
"static",
"void",
"enable",
"indenting",
"(",
"transformer",
"transformer",
",",
"int",
"indent",
"amount",
")",
"{",
"assert",
"not",
"null",
"(",
"transformer",
",",
"\"",
"transformer",
"must",
"not",
"be",
"null",
"\"",
")",
";",
"if",
"(",
"indent",
"amount",
"<",
"0",
")",
"{",
"throw",
"new",
"illegal",
"argument",
"exception",
"(",
"\"",
"invalid",
"indent",
"amount",
"(",
"must",
"not",
"be",
"less",
"than",
"zero",
")",
":",
"\"",
"+",
"indent",
"amount",
")",
";",
"}",
"transformer",
"set",
"output",
"property",
"(",
"output",
"keys",
"indent",
",",
"\"",
"yes",
"\"",
")",
";",
"try",
"{",
"/",
"/",
"xalan",
"-",
"specific",
",",
"but",
"this",
"is",
"the",
"most",
"common",
"xslt",
"engine",
"in",
"any",
"case",
"transformer",
"set",
"output",
"property",
"(",
"\"",
"{",
"http",
":",
"/",
"/",
"xml",
"apache",
"org",
"/",
"xalan",
"}",
"indent",
"-",
"amount",
"\"",
",",
"string",
"value",
"of",
"(",
"indent",
"amount",
")",
")",
";",
"}",
"catch",
"(",
"illegal",
"argument",
"exception",
"ignored",
")",
"{",
"}",
"}"
]
|
[
"verify",
"if",
"the",
"name",
"node",
"can",
"restart",
"properly",
"after",
"an",
"open",
"for",
"write",
"file",
"and",
"the",
"only",
"snapshot",
"it",
"was",
"present",
"in",
"were",
"deleted"
]
| [
"public",
"void",
"test",
"open",
"file",
"deletion",
"and",
"n",
"n",
"restart",
"(",
")",
"throws",
"exception",
"{",
"/",
"/",
"construct",
"the",
"directory",
"tree",
"final",
"path",
"snap",
"root",
"dir",
"=",
"new",
"path",
"(",
"\"",
"/",
"level",
"0",
"a",
"/",
"test",
"\"",
")",
";",
"final",
"string",
"hbase",
"file",
"name",
"=",
"\"",
"hbase",
"log",
"\"",
";",
"final",
"string",
"snap",
"1",
"name",
"=",
"\"",
"snap",
"1",
"\"",
";",
"/",
"/",
"create",
"a",
"file",
"with",
"few",
"blocks",
"get",
"its",
"output",
"stream",
"/",
"/",
"for",
"append",
"final",
"path",
"hbase",
"file",
"=",
"new",
"path",
"(",
"snap",
"root",
"dir",
",",
"hbase",
"file",
"name",
")",
";",
"create",
"file",
"(",
"hbase",
"file",
")",
";",
"f",
"s",
"data",
"output",
"stream",
"hbase",
"output",
"stream",
"=",
"fs",
"append",
"(",
"hbase",
"file",
")",
";",
"int",
"new",
"write",
"length",
"=",
"(",
"int",
")",
"(",
"blocksize",
"*",
"1",
"5",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"new",
"write",
"length",
"]",
";",
"random",
"random",
"=",
"new",
"random",
"(",
")",
";",
"random",
"next",
"bytes",
"(",
"buf",
")",
";",
"/",
"/",
"write",
"more",
"data",
"to",
"the",
"file",
"write",
"to",
"stream",
"(",
"hbase",
"output",
"stream",
",",
"buf",
")",
";",
"/",
"/",
"take",
"a",
"snapshot",
"while",
"the",
"file",
"is",
"open",
"for",
"write",
"final",
"path",
"snap",
"1",
"dir",
"=",
"snapshot",
"test",
"helper",
"create",
"snapshot",
"(",
"fs",
",",
"snap",
"root",
"dir",
",",
"snap",
"1",
"name",
")",
";",
"log",
"info",
"(",
"\"",
"open",
"file",
"status",
"in",
"snap",
":",
"\"",
"+",
"fs",
"get",
"file",
"status",
"(",
"new",
"path",
"(",
"snap",
"1",
"dir",
",",
"hbase",
"file",
"name",
")",
")",
")",
";",
"/",
"/",
"delete",
"the",
"open",
"file",
"and",
"the",
"snapshot",
"while",
"/",
"/",
"its",
"output",
"stream",
"is",
"still",
"open",
"fs",
"delete",
"(",
"hbase",
"file",
",",
"true",
")",
";",
"fs",
"delete",
"snapshot",
"(",
"snap",
"root",
"dir",
",",
"snap",
"1",
"name",
")",
";",
"assert",
"assert",
"false",
"(",
"fs",
"exists",
"(",
"hbase",
"file",
")",
")",
";",
"/",
"/",
"verify",
"file",
"existence",
"after",
"the",
"name",
"node",
"restart",
"cluster",
"restart",
"name",
"node",
"(",
")",
";",
"cluster",
"wait",
"active",
"(",
")",
";",
"assert",
"assert",
"false",
"(",
"fs",
"exists",
"(",
"hbase",
"file",
")",
")",
";",
"}"
]
|
[
"prints",
"the",
"command",
"-",
"line",
"usage",
"for",
"the",
"application",
"based",
"on",
"the",
"options",
"supported",
"by",
"this",
"builder"
]
| [
"void",
"print",
"usage",
"(",
")",
";"
]
|
[
"returns",
"an",
"enumeration",
"of",
"u",
"r",
"ls",
"representing",
"all",
"the",
"resources",
"with",
"the",
"given",
"name",
"by",
"searching",
"the",
"class",
"loader",
"'",
"s",
"classpath"
]
| [
"protected",
"enumeration",
"/",
"*",
"<",
"url",
">",
"*",
"/",
"find",
"resources",
"(",
"string",
"name",
",",
"boolean",
"parent",
"has",
"been",
"searched",
")",
"throws",
"i",
"o",
"exception",
"{",
"enumeration",
"/",
"*",
"<",
"url",
">",
"*",
"/",
"mine",
"=",
"new",
"resource",
"enumeration",
"(",
"name",
")",
";",
"enumeration",
"/",
"*",
"<",
"url",
">",
"*",
"/",
"base",
";",
"if",
"(",
"parent",
"!",
"=",
"null",
"&",
"&",
"(",
"!",
"parent",
"has",
"been",
"searched",
"|",
"|",
"parent",
"!",
"=",
"get",
"parent",
"(",
")",
")",
")",
"{",
"/",
"/",
"delegate",
"to",
"the",
"parent",
":",
"base",
"=",
"parent",
"get",
"resources",
"(",
"name",
")",
";",
"/",
"/",
"note",
":",
"could",
"cause",
"overlaps",
"in",
"case",
"/",
"/",
"class",
"loader",
"this",
"parent",
"has",
"matches",
"and",
"/",
"/",
"parent",
"has",
"been",
"searched",
"is",
"true",
"}",
"else",
"{",
"/",
"/",
"class",
"loader",
"this",
"parent",
"is",
"already",
"delegated",
"to",
"for",
"example",
"from",
"/",
"/",
"class",
"loader",
"get",
"resources",
",",
"no",
"need",
":",
"base",
"=",
"new",
"collection",
"utils",
"empty",
"enumeration",
"(",
")",
";",
"}",
"if",
"(",
"is",
"parent",
"first",
"(",
"name",
")",
")",
"{",
"/",
"/",
"normal",
"case",
"return",
"collection",
"utils",
"append",
"(",
"base",
",",
"mine",
")",
";",
"}",
"if",
"(",
"ignore",
"base",
")",
"{",
"return",
"get",
"root",
"loader",
"(",
")",
"=",
"=",
"null",
"?",
"mine",
":",
"collection",
"utils",
"append",
"(",
"mine",
",",
"get",
"root",
"loader",
"(",
")",
"get",
"resources",
"(",
"name",
")",
")",
";",
"}",
"/",
"/",
"parent",
"last",
":",
"return",
"collection",
"utils",
"append",
"(",
"mine",
",",
"base",
")",
";",
"}"
]
|
[
"returns",
"{",
"@",
"link",
"sorted",
"set",
"multimap",
"#",
"as",
"map",
"multimap",
"as",
"map",
"(",
")",
"}",
",",
"with",
"its",
"type",
"corrected",
"from",
"{",
"@",
"code",
"map",
"<",
"k",
",",
"collection",
"<",
"v",
">",
">",
"}",
"to",
"{",
"@",
"code",
"map",
"<",
"k",
",",
"sorted",
"set",
"<",
"v",
">",
">",
"}"
]
| [
"public",
"static",
"<",
"k",
",",
"v",
">",
"map",
"<",
"k",
",",
"sorted",
"set",
"<",
"v",
">",
">",
"as",
"map",
"(",
"sorted",
"set",
"multimap",
"<",
"k",
",",
"v",
">",
"multimap",
")",
"{",
"return",
"(",
"map",
"<",
"k",
",",
"sorted",
"set",
"<",
"v",
">",
">",
")",
"(",
"map",
"<",
"k",
",",
"?",
">",
")",
"multimap",
"as",
"map",
"(",
")",
";",
"}"
]
|
[
"this",
"is",
"a",
"utility",
"method",
"which",
"returns",
"the",
"type",
"of",
"uri"
]
| [
"private",
"static",
"@",
"source",
"uri",
"type",
"int",
"get",
"source",
"uri",
"type",
"(",
"final",
"uri",
"uri",
")",
"{",
"if",
"(",
"uri",
"=",
"=",
"null",
")",
"{",
"return",
"source",
"type",
"unknown",
";",
"}",
"if",
"(",
"uri",
"util",
"is",
"network",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"network",
";",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"local",
"file",
"uri",
"(",
"uri",
")",
")",
"{",
"if",
"(",
"media",
"utils",
"is",
"video",
"(",
"media",
"utils",
"extract",
"mime",
"(",
"uri",
"get",
"path",
"(",
")",
")",
")",
")",
"{",
"return",
"source",
"type",
"local",
"video",
"file",
";",
"}",
"else",
"{",
"return",
"source",
"type",
"local",
"image",
"file",
";",
"}",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"local",
"content",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"local",
"content",
";",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"local",
"asset",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"local",
"asset",
";",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"local",
"resource",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"local",
"resource",
";",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"data",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"data",
";",
"}",
"else",
"if",
"(",
"uri",
"util",
"is",
"qualified",
"resource",
"uri",
"(",
"uri",
")",
")",
"{",
"return",
"source",
"type",
"qualified",
"resource",
";",
"}",
"else",
"{",
"return",
"source",
"type",
"unknown",
";",
"}",
"}"
]
|
[
"returns",
"a",
"copy",
"of",
"the",
"manifest",
"including",
"only",
"the",
"streams",
"specified",
"by",
"the",
"given",
"keys",
"if",
"the",
"manifest",
"is",
"unchanged",
"then",
"the",
"instance",
"may",
"return",
"itself"
]
| [
"t",
"copy",
"(",
"list",
"<",
"stream",
"key",
">",
"stream",
"keys",
")",
";"
]
|
[
"test",
"if",
"the",
"waiter",
"that",
"is",
"waiting",
"on",
"availability",
"of",
"more",
"memory",
"is",
"cleaned",
"up",
"when",
"an",
"interruption",
"occurs"
]
| [
"public",
"void",
"test",
"cleanup",
"memory",
"availability",
"waiter",
"on",
"interruption",
"(",
")",
"throws",
"exception",
"{",
"buffer",
"pool",
"pool",
"=",
"new",
"buffer",
"pool",
"(",
"2",
",",
"1",
",",
"metrics",
",",
"time",
",",
"metric",
"group",
")",
";",
"long",
"block",
"time",
"=",
"5000",
";",
"pool",
"allocate",
"(",
"1",
",",
"max",
"block",
"time",
"ms",
")",
";",
"thread",
"t",
"1",
"=",
"new",
"thread",
"(",
"new",
"buffer",
"pool",
"allocator",
"(",
"pool",
",",
"block",
"time",
")",
")",
";",
"thread",
"t",
"2",
"=",
"new",
"thread",
"(",
"new",
"buffer",
"pool",
"allocator",
"(",
"pool",
",",
"block",
"time",
")",
")",
";",
"/",
"/",
"start",
"thread",
"t",
"1",
"which",
"will",
"try",
"to",
"allocate",
"more",
"memory",
"on",
"to",
"the",
"buffer",
"pool",
"t",
"1",
"start",
"(",
")",
";",
"/",
"/",
"sleep",
"for",
"5",
"0",
"0ms",
"condition",
"variable",
"c",
"1",
"associated",
"with",
"pool",
"allocate",
"(",
")",
"by",
"thread",
"t",
"1",
"will",
"be",
"inserted",
"in",
"the",
"waiters",
"queue",
"thread",
"sleep",
"(",
"500",
")",
";",
"deque",
"<",
"condition",
">",
"waiters",
"=",
"pool",
"waiters",
"(",
")",
";",
"/",
"/",
"get",
"the",
"condition",
"object",
"associated",
"with",
"pool",
"allocate",
"(",
")",
"by",
"thread",
"t",
"1",
"condition",
"c",
"1",
"=",
"waiters",
"get",
"first",
"(",
")",
";",
"/",
"/",
"start",
"thread",
"t",
"2",
"which",
"will",
"try",
"to",
"allocate",
"more",
"memory",
"on",
"to",
"the",
"buffer",
"pool",
"t",
"2",
"start",
"(",
")",
";",
"/",
"/",
"sleep",
"for",
"5",
"0",
"0ms",
"condition",
"variable",
"c",
"2",
"associated",
"with",
"pool",
"allocate",
"(",
")",
"by",
"thread",
"t",
"2",
"will",
"be",
"inserted",
"in",
"the",
"waiters",
"queue",
"the",
"waiters",
"queue",
"will",
"have",
"2",
"entries",
"c",
"1",
"and",
"c",
"2",
"thread",
"sleep",
"(",
"500",
")",
";",
"t",
"1",
"interrupt",
"(",
")",
";",
"/",
"/",
"sleep",
"for",
"5",
"0",
"0ms",
"thread",
"sleep",
"(",
"500",
")",
";",
"/",
"/",
"get",
"the",
"condition",
"object",
"associated",
"with",
"allocate",
"(",
")",
"by",
"thread",
"t",
"2",
"condition",
"c",
"2",
"=",
"waiters",
"get",
"last",
"(",
")",
";",
"t",
"2",
"interrupt",
"(",
")",
";",
"assert",
"not",
"equals",
"(",
"c",
"1",
",",
"c",
"2",
")",
";",
"t",
"1",
"join",
"(",
")",
";",
"t",
"2",
"join",
"(",
")",
";",
"/",
"/",
"both",
"the",
"allocate",
"(",
")",
"called",
"by",
"threads",
"t",
"1",
"and",
"t",
"2",
"should",
"have",
"been",
"interrupted",
"and",
"the",
"waiters",
"queue",
"should",
"be",
"empty",
"assert",
"equals",
"(",
"pool",
"queued",
"(",
")",
",",
"0",
")",
";",
"}"
]
|
[
"we",
"expect",
"the",
"read",
"to",
"fail",
"with",
"an",
"fnfe",
":",
"open",
"will",
"be",
"happy"
]
| [
"private",
"void",
"expect",
"exception",
"when",
"reading",
"open",
"file",
"a",
"p",
"i",
"(",
"final",
"s",
"3",
"a",
"file",
"system",
"fs",
",",
"final",
"path",
"test",
"file",
"path",
",",
"final",
"string",
"text",
",",
"final",
"file",
"status",
"status",
")",
"throws",
"exception",
"{",
"final",
"future",
"data",
"input",
"stream",
"builder",
"builder",
"=",
"fs",
"open",
"file",
"(",
"test",
"file",
"path",
")",
";",
"if",
"(",
"status",
"!",
"=",
"null",
")",
"{",
"builder",
"with",
"file",
"status",
"(",
"status",
")",
";",
"}",
"try",
"(",
"f",
"s",
"data",
"input",
"stream",
"in",
"=",
"builder",
"build",
"(",
")",
"get",
"(",
")",
")",
"{",
"intercept",
"(",
"file",
"not",
"found",
"exception",
"class",
",",
"(",
")",
"-",
">",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"text",
"length",
"(",
")",
"]",
";",
"return",
"in",
"read",
"(",
"bytes",
",",
"0",
",",
"bytes",
"length",
")",
";",
"}",
")",
";",
"}",
"}"
]
|
[
"gets",
"the",
"name",
"of",
"the",
"checksum",
"algorithm"
]
| [
"public",
"string",
"get",
"name",
"(",
")",
"{",
"return",
"name",
";",
"}"
]
|
[
"parses",
"an",
"environment",
"file",
"from",
"an",
"url"
]
| [
"public",
"static",
"environment",
"parse",
"(",
"url",
"url",
")",
"throws",
"i",
"o",
"exception",
"{",
"try",
"{",
"return",
"new",
"config",
"util",
"lower",
"case",
"yaml",
"mapper",
"(",
")",
"read",
"value",
"(",
"url",
",",
"environment",
"class",
")",
";",
"}",
"catch",
"(",
"json",
"mapping",
"exception",
"e",
")",
"{",
"throw",
"new",
"sql",
"client",
"exception",
"(",
"\"",
"could",
"not",
"parse",
"environment",
"file",
"cause",
":",
"\"",
"+",
"e",
"get",
"message",
"(",
")",
")",
";",
"}",
"}"
]
|
[
"a",
"filter",
"for",
"a",
"field",
"based",
"on",
"several",
"terms",
"matching",
"on",
"any",
"of",
"them"
]
| [
"public",
"static",
"terms",
"query",
"builder",
"terms",
"query",
"(",
"string",
"name",
",",
"int",
"values",
")",
"{",
"return",
"new",
"terms",
"query",
"builder",
"(",
"name",
",",
"values",
")",
";",
"}"
]
|
[
"whether",
"{",
"@",
"link",
"#",
"collect",
"(",
"object",
")",
"}",
"has",
"been",
"called"
]
| [
"public",
"boolean",
"is",
"collected",
"(",
")",
"{",
"return",
"collected",
";",
"}"
]
|
[
"expose",
"underlying",
"{",
"@",
"link",
"socket",
"u",
"d",
"t",
"}",
"for",
"debugging",
"and",
"monitoring"
]
| [
"public",
"static",
"socket",
"u",
"d",
"t",
"socket",
"u",
"d",
"t",
"(",
"final",
"channel",
"channel",
")",
"{",
"final",
"channel",
"u",
"d",
"t",
"channel",
"u",
"d",
"t",
"=",
"channel",
"u",
"d",
"t",
"(",
"channel",
")",
";",
"if",
"(",
"channel",
"u",
"d",
"t",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"channel",
"u",
"d",
"t",
"socket",
"u",
"d",
"t",
"(",
")",
";",
"}",
"}"
]
|
[
"read",
"an",
"unsigned",
"integer"
]
| [
"public",
"static",
"int",
"read",
"unsigned",
"int",
"(",
"byte",
"input",
"in",
",",
"int",
"zwidth",
",",
"boolean",
"fill",
"on",
"right",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"!",
"fill",
"on",
"right",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"zwidth",
";",
"i",
">",
"=",
"0",
";",
"i",
"-",
"-",
")",
"{",
"result",
"=",
"(",
"result",
">",
">",
">",
"8",
")",
"|",
"(",
"(",
"in",
"read",
"byte",
"(",
")",
"&",
"0xff",
")",
"<",
"<",
"24",
")",
";",
"}",
"result",
">",
">",
">",
"=",
"(",
"3",
"-",
"zwidth",
")",
"*",
"8",
";",
"}",
"else",
"{",
"for",
"(",
"int",
"i",
"=",
"zwidth",
";",
"i",
">",
"=",
"0",
";",
"i",
"-",
"-",
")",
"{",
"result",
"=",
"(",
"result",
">",
">",
">",
"8",
")",
"|",
"(",
"(",
"in",
"read",
"byte",
"(",
")",
"&",
"0xff",
")",
"<",
"<",
"24",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
]
|
[
"<",
"code",
">",
"optional",
"string",
"prefix",
"=",
"1",
";",
"<",
"code",
">"
]
| [
"public",
"boolean",
"has",
"prefix",
"(",
")",
"{",
"return",
"(",
"(",
"bit",
"field",
"0",
"&",
"0x",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"1",
")",
"=",
"=",
"0x",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"1",
")",
";",
"}"
]
|
[
"model",
"tests",
"for",
"additional",
"properties",
"array"
]
| [
"public",
"void",
"test",
"additional",
"properties",
"array",
"(",
")",
"{",
"/",
"/",
"todo",
":",
"test",
"additional",
"properties",
"array",
"}"
]
|
[
"specify",
"the",
"memory",
"cache",
"size",
"in",
"bytes",
"to",
"use",
"for",
"the",
"most",
"recent",
"images",
"a",
"size",
"of",
"0",
"disables",
"in",
"-",
"memory",
"caching"
]
| [
"public",
"builder",
"with",
"cache",
"size",
"(",
"int",
"max",
"byte",
"count",
")",
"{",
"if",
"(",
"max",
"byte",
"count",
"<",
"0",
")",
"{",
"throw",
"new",
"illegal",
"argument",
"exception",
"(",
"\"",
"max",
"byte",
"count",
"<",
"0",
":",
"\"",
"+",
"max",
"byte",
"count",
")",
";",
"}",
"cache",
"=",
"new",
"platform",
"lru",
"cache",
"(",
"max",
"byte",
"count",
")",
";",
"return",
"this",
";",
"}"
]
|
[
"test",
"to",
"verify",
"the",
"race",
"between",
"finalize",
"block",
"and",
"lease",
"recovery"
]
| [
"public",
"void",
"test",
"race",
"between",
"replica",
"recovery",
"and",
"finalize",
"block",
"(",
")",
"throws",
"exception",
"{",
"tear",
"down",
"(",
")",
";",
"/",
"/",
"stop",
"the",
"mocked",
"dn",
"started",
"in",
"startup",
"(",
")",
"configuration",
"conf",
"=",
"new",
"hdfs",
"configuration",
"(",
")",
";",
"conf",
"set",
"(",
"d",
"f",
"s",
"config",
"keys",
"dfs",
"datanode",
"xceiver",
"stop",
"timeout",
"millis",
"key",
",",
"\"",
"1000",
"\"",
")",
";",
"mini",
"d",
"f",
"s",
"cluster",
"cluster",
"=",
"new",
"mini",
"d",
"f",
"s",
"cluster",
"builder",
"(",
"conf",
")",
"num",
"data",
"nodes",
"(",
"1",
")",
"build",
"(",
")",
";",
"try",
"{",
"cluster",
"wait",
"cluster",
"up",
"(",
")",
";",
"distributed",
"file",
"system",
"fs",
"=",
"cluster",
"get",
"file",
"system",
"(",
")",
";",
"path",
"path",
"=",
"new",
"path",
"(",
"\"",
"/",
"test",
"\"",
")",
";",
"f",
"s",
"data",
"output",
"stream",
"out",
"=",
"fs",
"create",
"(",
"path",
")",
";",
"out",
"write",
"bytes",
"(",
"\"",
"data",
"\"",
")",
";",
"out",
"hsync",
"(",
")",
";",
"list",
"<",
"located",
"block",
">",
"blocks",
"=",
"d",
"f",
"s",
"test",
"util",
"get",
"all",
"blocks",
"(",
"fs",
"open",
"(",
"path",
")",
")",
";",
"final",
"located",
"block",
"block",
"=",
"blocks",
"get",
"(",
"0",
")",
";",
"final",
"data",
"node",
"data",
"node",
"=",
"cluster",
"get",
"data",
"nodes",
"(",
")",
"get",
"(",
"0",
")",
";",
"final",
"atomic",
"boolean",
"recovery",
"init",
"result",
"=",
"new",
"atomic",
"boolean",
"(",
"true",
")",
";",
"thread",
"recovery",
"thread",
"=",
"new",
"thread",
"(",
")",
"{",
"@",
"override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"datanode",
"info",
"[",
"]",
"locations",
"=",
"block",
"get",
"locations",
"(",
")",
";",
"final",
"recovering",
"block",
"recovering",
"block",
"=",
"new",
"recovering",
"block",
"(",
"block",
"get",
"block",
"(",
")",
",",
"locations",
",",
"block",
"get",
"block",
"(",
")",
"get",
"generation",
"stamp",
"(",
")",
"+",
"1",
")",
";",
"try",
"(",
"auto",
"closeable",
"lock",
"lock",
"=",
"data",
"node",
"data",
"acquire",
"dataset",
"lock",
"(",
")",
")",
"{",
"thread",
"sleep",
"(",
"2000",
")",
";",
"data",
"node",
"init",
"replica",
"recovery",
"(",
"recovering",
"block",
")",
";",
"}",
"}",
"catch",
"(",
"exception",
"e",
")",
"{",
"recovery",
"init",
"result",
"set",
"(",
"false",
")",
";",
"}",
"}",
"}",
";",
"recovery",
"thread",
"start",
"(",
")",
";",
"try",
"{",
"out",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"i",
"o",
"exception",
"e",
")",
"{",
"assert",
"assert",
"true",
"(",
"\"",
"writing",
"should",
"fail",
"\"",
",",
"e",
"get",
"message",
"(",
")",
"contains",
"(",
"\"",
"are",
"bad",
"aborting",
"\"",
")",
")",
";",
"}",
"finally",
"{",
"recovery",
"thread",
"join",
"(",
")",
";",
"}",
"assert",
"assert",
"true",
"(",
"\"",
"recovery",
"should",
"be",
"initiated",
"successfully",
"\"",
",",
"recovery",
"init",
"result",
"get",
"(",
")",
")",
";",
"data",
"node",
"update",
"replica",
"under",
"recovery",
"(",
"block",
"get",
"block",
"(",
")",
",",
"block",
"get",
"block",
"(",
")",
"get",
"generation",
"stamp",
"(",
")",
"+",
"1",
",",
"block",
"get",
"block",
"(",
")",
"get",
"block",
"id",
"(",
")",
",",
"block",
"get",
"block",
"size",
"(",
")",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"null",
"!",
"=",
"cluster",
")",
"{",
"cluster",
"shutdown",
"(",
")",
";",
"cluster",
"=",
"null",
";",
"}",
"}",
"}"
]
|
[
"tests",
"the",
"situation",
"where",
"the",
"property",
"only",
"has",
"a",
"getter"
]
| [
"public",
"void",
"test",
"with",
"only",
"setter",
"(",
")",
"throws",
"exception",
"{",
"model",
"m",
"bean",
"info",
"inf",
"=",
"get",
"m",
"bean",
"info",
"from",
"assembler",
"(",
")",
";",
"model",
"m",
"bean",
"attribute",
"info",
"attr",
"=",
"inf",
"get",
"attribute",
"(",
"\"",
"nick",
"name",
"\"",
")",
";",
"assert",
"that",
"(",
"attr",
")",
"as",
"(",
"\"",
"attribute",
"should",
"not",
"be",
"null",
"\"",
")",
"is",
"not",
"null",
"(",
")",
";",
"}"
]
|
[
"initialize",
"the",
"view",
"{",
"@",
"link",
"bean",
"factory",
"}",
"from",
"the",
"{",
"@",
"code",
"resource",
"bundle",
"}",
",",
"for",
"the",
"given",
"{",
"@",
"link",
"locale",
"locale",
"}",
"synchronized",
"because",
"of",
"access",
"by",
"parallel",
"threads"
]
| [
"protected",
"synchronized",
"bean",
"factory",
"init",
"factory",
"(",
"locale",
"locale",
")",
"throws",
"beans",
"exception",
"{",
"/",
"/",
"try",
"to",
"find",
"cached",
"factory",
"for",
"locale",
":",
"/",
"/",
"have",
"we",
"already",
"encountered",
"that",
"locale",
"before",
"?",
"if",
"(",
"is",
"cache",
"(",
")",
")",
"{",
"bean",
"factory",
"cached",
"factory",
"=",
"this",
"locale",
"cache",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"cached",
"factory",
"!",
"=",
"null",
")",
"{",
"return",
"cached",
"factory",
";",
"}",
"}",
"/",
"/",
"build",
"list",
"of",
"resource",
"bundle",
"references",
"for",
"locale",
"list",
"<",
"resource",
"bundle",
">",
"bundles",
"=",
"new",
"array",
"list",
"<",
">",
"(",
"this",
"basenames",
"length",
")",
";",
"for",
"(",
"string",
"basename",
":",
"this",
"basenames",
")",
"{",
"bundles",
"add",
"(",
"get",
"bundle",
"(",
"basename",
",",
"locale",
")",
")",
";",
"}",
"/",
"/",
"try",
"to",
"find",
"cached",
"factory",
"for",
"resource",
"bundle",
"list",
":",
"/",
"/",
"even",
"if",
"locale",
"was",
"different",
",",
"same",
"bundles",
"might",
"have",
"been",
"found",
"if",
"(",
"is",
"cache",
"(",
")",
")",
"{",
"bean",
"factory",
"cached",
"factory",
"=",
"this",
"bundle",
"cache",
"get",
"(",
"bundles",
")",
";",
"if",
"(",
"cached",
"factory",
"!",
"=",
"null",
")",
"{",
"this",
"locale",
"cache",
"put",
"(",
"locale",
",",
"cached",
"factory",
")",
";",
"return",
"cached",
"factory",
";",
"}",
"}",
"/",
"/",
"create",
"child",
"application",
"context",
"for",
"views",
"generic",
"web",
"application",
"context",
"factory",
"=",
"new",
"generic",
"web",
"application",
"context",
"(",
")",
";",
"factory",
"set",
"parent",
"(",
"get",
"application",
"context",
"(",
")",
")",
";",
"factory",
"set",
"servlet",
"context",
"(",
"get",
"servlet",
"context",
"(",
")",
")",
";",
"/",
"/",
"load",
"bean",
"definitions",
"from",
"resource",
"bundle",
"org",
"springframework",
"beans",
"factory",
"support",
"properties",
"bean",
"definition",
"reader",
"reader",
"=",
"new",
"org",
"springframework",
"beans",
"factory",
"support",
"properties",
"bean",
"definition",
"reader",
"(",
"factory",
")",
";",
"reader",
"set",
"default",
"parent",
"bean",
"(",
"this",
"default",
"parent",
"view",
")",
";",
"for",
"(",
"resource",
"bundle",
"bundle",
":",
"bundles",
")",
"{",
"reader",
"register",
"bean",
"definitions",
"(",
"bundle",
")",
";",
"}",
"factory",
"refresh",
"(",
")",
";",
"/",
"/",
"cache",
"factory",
"for",
"both",
"locale",
"and",
"resource",
"bundle",
"list",
"if",
"(",
"is",
"cache",
"(",
")",
")",
"{",
"this",
"locale",
"cache",
"put",
"(",
"locale",
",",
"factory",
")",
";",
"this",
"bundle",
"cache",
"put",
"(",
"bundles",
",",
"factory",
")",
";",
"}",
"return",
"factory",
";",
"}"
]
|
[
"create",
"a",
"gauge",
"in",
"the",
"registry"
]
| [
"protected",
"final",
"mutable",
"gauge",
"long",
"gauge",
"(",
"string",
"name",
",",
"string",
"desc",
")",
"{",
"return",
"registry",
"new",
"gauge",
"(",
"name",
",",
"desc",
",",
"0l",
")",
";",
"}"
]
|
[
"1",
"submit",
"a",
"long",
"running",
"guaranteed",
"container",
"to",
"hog",
"all",
"nm",
"resources",
"2",
"submit",
"6",
"opportunistic",
"containers",
",",
"all",
"of",
"which",
"will",
"be",
"queued",
"3",
"update",
"the",
"queue",
"limit",
"to",
"2",
"4",
"ensure",
"only",
"2",
"containers",
"remain",
"in",
"the",
"queue",
",",
"and",
"4",
"are",
"de",
"-",
"queued"
]
| [
"public",
"void",
"test",
"queue",
"shedding",
"(",
")",
"throws",
"exception",
"{",
"container",
"manager",
"start",
"(",
")",
";",
"container",
"launch",
"context",
"container",
"launch",
"context",
"=",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
";",
"container",
"launch",
"context",
"set",
"commands",
"(",
"arrays",
"as",
"list",
"(",
"\"",
"sleep",
"100",
"\"",
")",
")",
";",
"list",
"<",
"start",
"container",
"request",
">",
"list",
"=",
"new",
"array",
"list",
"<",
">",
"(",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"container",
"launch",
"context",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"0",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"2048",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"guaranteed",
")",
")",
")",
";",
"start",
"containers",
"request",
"all",
"requests",
"=",
"start",
"containers",
"request",
"new",
"instance",
"(",
"list",
")",
";",
"container",
"manager",
"start",
"containers",
"(",
"all",
"requests",
")",
";",
"list",
"=",
"new",
"array",
"list",
"<",
">",
"(",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"1",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"2",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"3",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"4",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"5",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"list",
"add",
"(",
"start",
"container",
"request",
"new",
"instance",
"(",
"record",
"factory",
"new",
"record",
"instance",
"(",
"container",
"launch",
"context",
"class",
")",
",",
"create",
"container",
"token",
"(",
"create",
"container",
"id",
"(",
"6",
")",
",",
"dummy",
"rm",
"identifier",
",",
"context",
"get",
"node",
"id",
"(",
")",
",",
"user",
",",
"builder",
"utils",
"new",
"resource",
"(",
"512",
",",
"1",
")",
",",
"context",
"get",
"container",
"token",
"secret",
"manager",
"(",
")",
",",
"null",
",",
"execution",
"type",
"opportunistic",
")",
")",
")",
";",
"all",
"requests",
"=",
"start",
"containers",
"request",
"new",
"instance",
"(",
"list",
")",
";",
"container",
"manager",
"start",
"containers",
"(",
"all",
"requests",
")",
";",
"container",
"scheduler",
"container",
"scheduler",
"=",
"container",
"manager",
"get",
"container",
"scheduler",
"(",
")",
";",
"/",
"/",
"ensure",
"all",
"containers",
"are",
"properly",
"queued",
"generic",
"test",
"utils",
"wait",
"for",
"(",
"(",
")",
"-",
">",
"container",
"scheduler",
"get",
"num",
"queued",
"containers",
"(",
")",
"=",
"=",
"6",
"&",
"&",
"metrics",
"get",
"queued",
"opportunistic",
"containers",
"(",
")",
"=",
"=",
"6",
",",
"100",
",",
"3000",
")",
";",
"assert",
"assert",
"equals",
"(",
"6",
",",
"container",
"scheduler",
"get",
"num",
"queued",
"containers",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"6",
",",
"metrics",
"get",
"queued",
"opportunistic",
"containers",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"0",
",",
"metrics",
"get",
"queued",
"guaranteed",
"containers",
"(",
")",
")",
";",
"container",
"queuing",
"limit",
"container",
"queuing",
"limit",
"=",
"container",
"queuing",
"limit",
"new",
"instance",
"(",
")",
";",
"container",
"queuing",
"limit",
"set",
"max",
"queue",
"length",
"(",
"2",
")",
";",
"container",
"scheduler",
"update",
"queuing",
"limit",
"(",
"container",
"queuing",
"limit",
")",
";",
"generic",
"test",
"utils",
"wait",
"for",
"(",
"(",
")",
"-",
">",
"container",
"scheduler",
"get",
"num",
"queued",
"containers",
"(",
")",
"=",
"=",
"2",
",",
"100",
",",
"3000",
")",
";",
"assert",
"assert",
"equals",
"(",
"2",
",",
"container",
"scheduler",
"get",
"num",
"queued",
"containers",
"(",
")",
")",
";",
"list",
"<",
"container",
"id",
">",
"stat",
"list",
"=",
"new",
"array",
"list",
"<",
"container",
"id",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"7",
";",
"i",
"+",
"+",
")",
"{",
"stat",
"list",
"add",
"(",
"create",
"container",
"id",
"(",
"i",
")",
")",
";",
"}",
"get",
"container",
"statuses",
"request",
"stat",
"request",
"=",
"get",
"container",
"statuses",
"request",
"new",
"instance",
"(",
"stat",
"list",
")",
";",
"list",
"<",
"container",
"status",
">",
"container",
"statuses",
"=",
"container",
"manager",
"get",
"container",
"statuses",
"(",
"stat",
"request",
")",
"get",
"container",
"statuses",
"(",
")",
";",
"int",
"de",
"queued",
"containers",
"=",
"0",
";",
"int",
"num",
"queued",
"opp",
"containers",
"=",
"0",
";",
"for",
"(",
"container",
"status",
"status",
":",
"container",
"statuses",
")",
"{",
"if",
"(",
"status",
"get",
"execution",
"type",
"(",
")",
"=",
"=",
"execution",
"type",
"opportunistic",
")",
"{",
"if",
"(",
"status",
"get",
"diagnostics",
"(",
")",
"contains",
"(",
"\"",
"container",
"de",
"-",
"queued",
"to",
"meet",
"nm",
"queuing",
"limits",
"\"",
")",
")",
"{",
"de",
"queued",
"containers",
"+",
"+",
";",
"}",
"if",
"(",
"container",
"sub",
"state",
"scheduled",
"=",
"=",
"status",
"get",
"container",
"sub",
"state",
"(",
")",
")",
"{",
"num",
"queued",
"opp",
"containers",
"+",
"+",
";",
"}",
"}",
"}",
"assert",
"assert",
"equals",
"(",
"4",
",",
"de",
"queued",
"containers",
")",
";",
"assert",
"assert",
"equals",
"(",
"2",
",",
"num",
"queued",
"opp",
"containers",
")",
";",
"assert",
"assert",
"equals",
"(",
"2",
",",
"metrics",
"get",
"queued",
"opportunistic",
"containers",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"0",
",",
"metrics",
"get",
"queued",
"guaranteed",
"containers",
"(",
")",
")",
";",
"}"
]
|
[
"simple",
"test",
"partial",
"job"
]
| [
"public",
"void",
"test",
"partial",
"job",
"(",
")",
"throws",
"exception",
"{",
"job",
"id",
"job",
"id",
"=",
"new",
"job",
"id",
"p",
"b",
"impl",
"(",
")",
";",
"job",
"id",
"set",
"id",
"(",
"0",
")",
";",
"job",
"index",
"info",
"jii",
"=",
"new",
"job",
"index",
"info",
"(",
"0l",
",",
"system",
"current",
"time",
"millis",
"(",
")",
",",
"\"",
"user",
"\"",
",",
"\"",
"job",
"name",
"\"",
",",
"job",
"id",
",",
"3",
",",
"2",
",",
"\"",
"job",
"status",
"\"",
")",
";",
"partial",
"job",
"test",
"=",
"new",
"partial",
"job",
"(",
"jii",
",",
"job",
"id",
")",
";",
"assert",
"assert",
"equals",
"(",
"1",
"0f",
",",
"test",
"get",
"progress",
"(",
")",
",",
"0",
"0",
"0",
"1f",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"all",
"counters",
"(",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"tasks",
"(",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"tasks",
"(",
"task",
"type",
"map",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"task",
"(",
"new",
"task",
"id",
"p",
"b",
"impl",
"(",
")",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"task",
"attempt",
"completion",
"events",
"(",
"0",
",",
"100",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"map",
"attempt",
"completion",
"events",
"(",
"0",
",",
"100",
")",
")",
";",
"assert",
"true",
"(",
"test",
"check",
"access",
"(",
"user",
"group",
"information",
"get",
"current",
"user",
"(",
")",
",",
"null",
")",
")",
";",
"assert",
"null",
"(",
"test",
"get",
"a",
"m",
"infos",
"(",
")",
")",
";",
"}"
]
|
[
"return",
"the",
"intent",
"of",
"share",
"image"
]
| [
"public",
"static",
"intent",
"get",
"share",
"image",
"intent",
"(",
"final",
"uri",
"image",
"uri",
")",
"{",
"return",
"get",
"share",
"text",
"image",
"intent",
"(",
"\"",
"\"",
",",
"image",
"uri",
")",
";",
"}"
]
|
[
"atomically",
"adds",
"the",
"positive",
"value",
"n",
"to",
"the",
"requested",
"value",
"in",
"the",
"{",
"@",
"link",
"atomic",
"long",
"}",
"and",
"caps",
"the",
"result",
"at",
"{",
"@",
"link",
"long",
"#",
"max",
"value",
"}",
"and",
"returns",
"the",
"previous",
"value",
"and",
"considers",
"{",
"@",
"link",
"long",
"#",
"min",
"value",
"}",
"as",
"a",
"cancel",
"indication",
"(",
"no",
"addition",
"then",
")"
]
| [
"public",
"static",
"long",
"add",
"cancel",
"(",
"@",
"non",
"null",
"atomic",
"long",
"requested",
",",
"long",
"n",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"long",
"r",
"=",
"requested",
"get",
"(",
")",
";",
"if",
"(",
"r",
"=",
"=",
"long",
"min",
"value",
")",
"{",
"return",
"long",
"min",
"value",
";",
"}",
"if",
"(",
"r",
"=",
"=",
"long",
"max",
"value",
")",
"{",
"return",
"long",
"max",
"value",
";",
"}",
"long",
"u",
"=",
"add",
"cap",
"(",
"r",
",",
"n",
")",
";",
"if",
"(",
"requested",
"compare",
"and",
"set",
"(",
"r",
",",
"u",
")",
")",
"{",
"return",
"r",
";",
"}",
"}",
"}"
]
|
[
"tests",
"that",
"the",
"async",
"wait",
"operator",
"works",
"together",
"with",
"chaining"
]
| [
"public",
"void",
"test",
"operator",
"chain",
"with",
"processing",
"time",
"(",
")",
"throws",
"exception",
"{",
"job",
"vertex",
"chained",
"vertex",
"=",
"create",
"chained",
"vertex",
"(",
"new",
"my",
"async",
"function",
"(",
")",
",",
"new",
"my",
"async",
"function",
"(",
")",
")",
";",
"final",
"one",
"input",
"stream",
"task",
"test",
"harness",
"<",
"integer",
",",
"integer",
">",
"test",
"harness",
"=",
"new",
"one",
"input",
"stream",
"task",
"test",
"harness",
"<",
">",
"(",
"one",
"input",
"stream",
"task",
":",
":",
"new",
",",
"1",
",",
"1",
",",
"basic",
"type",
"info",
"int",
"type",
"info",
",",
"basic",
"type",
"info",
"int",
"type",
"info",
")",
";",
"test",
"harness",
"setup",
"output",
"for",
"singleton",
"operator",
"chain",
"(",
")",
";",
"test",
"harness",
"task",
"config",
"=",
"chained",
"vertex",
"get",
"configuration",
"(",
")",
";",
"final",
"stream",
"config",
"stream",
"config",
"=",
"test",
"harness",
"get",
"stream",
"config",
"(",
")",
";",
"final",
"stream",
"config",
"operator",
"chain",
"stream",
"config",
"=",
"new",
"stream",
"config",
"(",
"chained",
"vertex",
"get",
"configuration",
"(",
")",
")",
";",
"stream",
"config",
"set",
"stream",
"operator",
"factory",
"(",
"operator",
"chain",
"stream",
"config",
"get",
"stream",
"operator",
"factory",
"(",
"async",
"wait",
"operator",
"test",
"class",
"get",
"class",
"loader",
"(",
")",
")",
")",
";",
"test",
"harness",
"invoke",
"(",
")",
";",
"test",
"harness",
"wait",
"for",
"task",
"running",
"(",
")",
";",
"long",
"initial",
"timestamp",
"=",
"0l",
";",
"test",
"harness",
"process",
"element",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"5",
",",
"initial",
"timestamp",
")",
")",
";",
"test",
"harness",
"process",
"element",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"6",
",",
"initial",
"timestamp",
"+",
"1l",
")",
")",
";",
"test",
"harness",
"process",
"element",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"7",
",",
"initial",
"timestamp",
"+",
"2l",
")",
")",
";",
"test",
"harness",
"process",
"element",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"8",
",",
"initial",
"timestamp",
"+",
"3l",
")",
")",
";",
"test",
"harness",
"process",
"element",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"9",
",",
"initial",
"timestamp",
"+",
"4l",
")",
")",
";",
"test",
"harness",
"end",
"input",
"(",
")",
";",
"test",
"harness",
"wait",
"for",
"task",
"completion",
"(",
")",
";",
"list",
"<",
"object",
">",
"expected",
"output",
"=",
"new",
"linked",
"list",
"<",
">",
"(",
")",
";",
"expected",
"output",
"add",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"22",
",",
"initial",
"timestamp",
")",
")",
";",
"expected",
"output",
"add",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"26",
",",
"initial",
"timestamp",
"+",
"1l",
")",
")",
";",
"expected",
"output",
"add",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"30",
",",
"initial",
"timestamp",
"+",
"2l",
")",
")",
";",
"expected",
"output",
"add",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"34",
",",
"initial",
"timestamp",
"+",
"3l",
")",
")",
";",
"expected",
"output",
"add",
"(",
"new",
"stream",
"record",
"<",
">",
"(",
"38",
",",
"initial",
"timestamp",
"+",
"4l",
")",
")",
";",
"test",
"harness",
"util",
"assert",
"output",
"equals",
"sorted",
"(",
"\"",
"test",
"for",
"chained",
"operator",
"with",
"async",
"wait",
"operator",
"failed",
"\"",
",",
"expected",
"output",
",",
"test",
"harness",
"get",
"output",
"(",
")",
",",
"new",
"stream",
"record",
"comparator",
"(",
")",
")",
";",
"}"
]
|
[
"check",
"whether",
"provided",
"flow",
"rule",
"is",
"valid"
]
| [
"public",
"static",
"boolean",
"is",
"valid",
"rule",
"(",
"flow",
"rule",
"rule",
")",
"{",
"boolean",
"base",
"valid",
"=",
"rule",
"!",
"=",
"null",
"&",
"&",
"!",
"string",
"util",
"is",
"blank",
"(",
"rule",
"get",
"resource",
"(",
")",
")",
"&",
"&",
"rule",
"get",
"count",
"(",
")",
">",
"=",
"0",
"&",
"&",
"rule",
"get",
"grade",
"(",
")",
">",
"=",
"0",
"&",
"&",
"rule",
"get",
"strategy",
"(",
")",
">",
"=",
"0",
"&",
"&",
"rule",
"get",
"control",
"behavior",
"(",
")",
">",
"=",
"0",
";",
"if",
"(",
"!",
"base",
"valid",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"rule",
"get",
"grade",
"(",
")",
"=",
"=",
"rule",
"constant",
"flow",
"grade",
"qps",
")",
"{",
"/",
"/",
"check",
"strategy",
"and",
"control",
"(",
"shaping",
")",
"behavior",
"return",
"check",
"cluster",
"field",
"(",
"rule",
")",
"&",
"&",
"check",
"strategy",
"field",
"(",
"rule",
")",
"&",
"&",
"check",
"control",
"behavior",
"field",
"(",
"rule",
")",
";",
"}",
"else",
"if",
"(",
"rule",
"get",
"grade",
"(",
")",
"=",
"=",
"rule",
"constant",
"flow",
"grade",
"thread",
")",
"{",
"return",
"check",
"cluster",
"concurrent",
"field",
"(",
"rule",
")",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}"
]
|
[
"test",
"regular",
"operation",
",",
"including",
"command",
"line",
"parameter",
"parsing"
]
| [
"void",
"run",
"detached",
"mode",
"test",
"(",
"map",
"<",
"string",
",",
"string",
">",
"security",
"properties",
")",
"throws",
"exception",
"{",
"run",
"test",
"(",
"(",
")",
"-",
">",
"{",
"log",
"info",
"(",
"\"",
"starting",
"test",
"detached",
"mode",
"(",
")",
"\"",
")",
";",
"file",
"example",
"jar",
"location",
"=",
"get",
"test",
"jar",
"path",
"(",
"\"",
"streaming",
"word",
"count",
"jar",
"\"",
")",
";",
"/",
"/",
"get",
"temporary",
"file",
"for",
"reading",
"input",
"data",
"for",
"wordcount",
"example",
"file",
"tmp",
"in",
"file",
"=",
"tmp",
"new",
"file",
"(",
")",
";",
"file",
"utils",
"write",
"string",
"to",
"file",
"(",
"tmp",
"in",
"file",
",",
"word",
"count",
"data",
"text",
")",
";",
"array",
"list",
"<",
"string",
">",
"args",
"=",
"new",
"array",
"list",
"<",
">",
"(",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"j",
"\"",
")",
";",
"args",
"add",
"(",
"flink",
"uberjar",
"get",
"absolute",
"path",
"(",
")",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"t",
"\"",
")",
";",
"args",
"add",
"(",
"flink",
"lib",
"folder",
"get",
"absolute",
"path",
"(",
")",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"jm",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"7",
"6",
"8m",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"tm",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"1",
"0",
"2",
"4m",
"\"",
")",
";",
"if",
"(",
"security",
"properties",
"!",
"=",
"null",
")",
"{",
"for",
"(",
"map",
"entry",
"<",
"string",
",",
"string",
">",
"property",
":",
"security",
"properties",
"entry",
"set",
"(",
")",
")",
"{",
"args",
"add",
"(",
"\"",
"-",
"d",
"\"",
"+",
"property",
"get",
"key",
"(",
")",
"+",
"\"",
"=",
"\"",
"+",
"property",
"get",
"value",
"(",
")",
")",
";",
"}",
"}",
"args",
"add",
"(",
"\"",
"-",
"-",
"name",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"my",
"custom",
"name",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"-",
"application",
"type",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"apache",
"flink",
"1",
"x",
"\"",
")",
";",
"args",
"add",
"(",
"\"",
"-",
"-",
"detached",
"\"",
")",
";",
"runner",
"cluster",
"runner",
"=",
"start",
"with",
"args",
"(",
"args",
"to",
"array",
"(",
"new",
"string",
"[",
"args",
"size",
"(",
")",
"]",
")",
",",
"\"",
"job",
"manager",
"web",
"interface",
":",
"\"",
",",
"run",
"types",
"yarn",
"session",
")",
";",
"/",
"/",
"before",
"checking",
"any",
"strings",
"outputted",
"by",
"the",
"cli",
",",
"first",
"give",
"it",
"time",
"to",
"/",
"/",
"return",
"cluster",
"runner",
"join",
"(",
")",
";",
"/",
"/",
"actually",
"run",
"a",
"program",
",",
"otherwise",
"we",
"wouldn",
"'",
"t",
"necessarily",
"see",
"any",
"/",
"/",
"task",
"managers",
"/",
"/",
"be",
"brought",
"up",
"runner",
"job",
"runner",
"=",
"start",
"with",
"args",
"(",
"new",
"string",
"[",
"]",
"{",
"\"",
"run",
"\"",
",",
"\"",
"-",
"-",
"detached",
"\"",
",",
"example",
"jar",
"location",
"get",
"absolute",
"path",
"(",
")",
",",
"\"",
"-",
"-",
"input",
"\"",
",",
"tmp",
"in",
"file",
"get",
"absolute",
"file",
"(",
")",
"to",
"string",
"(",
")",
"}",
",",
"\"",
"job",
"has",
"been",
"submitted",
"with",
"job",
"i",
"d",
"\"",
",",
"run",
"types",
"cli",
"frontend",
")",
";",
"job",
"runner",
"join",
"(",
")",
";",
"/",
"/",
"in",
"\"",
"new",
"\"",
"mode",
"we",
"can",
"only",
"wait",
"after",
"the",
"job",
"is",
"submitted",
",",
"because",
"t",
"ms",
"/",
"/",
"are",
"spun",
"up",
"lazily",
"log",
"info",
"(",
"\"",
"waiting",
"until",
"two",
"containers",
"are",
"running",
"\"",
")",
";",
"/",
"/",
"wait",
"until",
"two",
"containers",
"are",
"running",
"while",
"(",
"get",
"running",
"containers",
"(",
")",
"<",
"2",
")",
"{",
"sleep",
"(",
"500",
")",
";",
"}",
"/",
"/",
"make",
"sure",
"we",
"have",
"two",
"t",
"ms",
"running",
"in",
"either",
"mode",
"long",
"start",
"time",
"=",
"system",
"nano",
"time",
"(",
")",
";",
"while",
"(",
"system",
"nano",
"time",
"(",
")",
"-",
"start",
"time",
"<",
"time",
"unit",
"nanoseconds",
"convert",
"(",
"10",
",",
"time",
"unit",
"seconds",
")",
"&",
"&",
"!",
"(",
"verify",
"strings",
"in",
"named",
"log",
"files",
"(",
"new",
"string",
"[",
"]",
"{",
"\"",
"switched",
"from",
"state",
"running",
"to",
"finished",
"\"",
"}",
",",
"\"",
"jobmanager",
"log",
"\"",
")",
")",
")",
"{",
"log",
"info",
"(",
"\"",
"still",
"waiting",
"for",
"cluster",
"to",
"finish",
"job",
"\"",
")",
";",
"sleep",
"(",
"500",
")",
";",
"}",
"log",
"info",
"(",
"\"",
"two",
"containers",
"are",
"running",
"killing",
"the",
"application",
"\"",
")",
";",
"/",
"/",
"kill",
"application",
"\"",
"externally",
"\"",
"try",
"{",
"yarn",
"client",
"yc",
"=",
"yarn",
"client",
"create",
"yarn",
"client",
"(",
")",
";",
"yc",
"init",
"(",
"yarn",
"configuration",
")",
";",
"yc",
"start",
"(",
")",
";",
"list",
"<",
"application",
"report",
">",
"apps",
"=",
"yc",
"get",
"applications",
"(",
"enum",
"set",
"of",
"(",
"yarn",
"application",
"state",
"running",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"1",
",",
"apps",
"size",
"(",
")",
")",
";",
"/",
"/",
"only",
"one",
"running",
"application",
"report",
"app",
"=",
"apps",
"get",
"(",
"0",
")",
";",
"assert",
"assert",
"equals",
"(",
"\"",
"my",
"custom",
"name",
"\"",
",",
"app",
"get",
"name",
"(",
")",
")",
";",
"assert",
"assert",
"equals",
"(",
"\"",
"apache",
"flink",
"1",
"x",
"\"",
",",
"app",
"get",
"application",
"type",
"(",
")",
")",
";",
"application",
"id",
"id",
"=",
"app",
"get",
"application",
"id",
"(",
")",
";",
"yc",
"kill",
"application",
"(",
"id",
")",
";",
"while",
"(",
"yc",
"get",
"applications",
"(",
"enum",
"set",
"of",
"(",
"yarn",
"application",
"state",
"killed",
")",
")",
"size",
"(",
")",
"=",
"=",
"0",
"&",
"&",
"yc",
"get",
"applications",
"(",
"enum",
"set",
"of",
"(",
"yarn",
"application",
"state",
"finished",
")",
")",
"size",
"(",
")",
"=",
"=",
"0",
")",
"{",
"sleep",
"(",
"500",
")",
";",
"}",
"}",
"catch",
"(",
"throwable",
"t",
")",
"{",
"log",
"warn",
"(",
"\"",
"killing",
"failed",
"\"",
",",
"t",
")",
";",
"assert",
"fail",
"(",
")",
";",
"}",
"finally",
"{",
"/",
"/",
"cleanup",
"the",
"yarn",
"-",
"properties",
"file",
"string",
"conf",
"dir",
"path",
"=",
"system",
"getenv",
"(",
"\"",
"flink",
"conf",
"dir",
"\"",
")",
";",
"file",
"config",
"directory",
"=",
"new",
"file",
"(",
"conf",
"dir",
"path",
")",
";",
"log",
"info",
"(",
"\"",
"test",
"detached",
"per",
"job",
"yarn",
"cluster",
"internal",
":",
"using",
"configuration",
"directory",
"\"",
"+",
"config",
"directory",
"get",
"absolute",
"path",
"(",
")",
")",
";",
"/",
"/",
"load",
"the",
"configuration",
"log",
"info",
"(",
"\"",
"test",
"detached",
"per",
"job",
"yarn",
"cluster",
"internal",
":",
"trying",
"to",
"load",
"configuration",
"file",
"\"",
")",
";",
"configuration",
"configuration",
"=",
"global",
"configuration",
"load",
"configuration",
"(",
"config",
"directory",
"get",
"absolute",
"path",
"(",
")",
")",
";",
"try",
"{",
"file",
"yarn",
"properties",
"file",
"=",
"flink",
"yarn",
"session",
"cli",
"get",
"yarn",
"properties",
"location",
"(",
"configuration",
"get",
"string",
"(",
"yarn",
"config",
"options",
"properties",
"file",
"location",
")",
")",
";",
"if",
"(",
"yarn",
"properties",
"file",
"exists",
"(",
")",
")",
"{",
"log",
"info",
"(",
"\"",
"test",
"detached",
"per",
"job",
"yarn",
"cluster",
"internal",
":",
"cleaning",
"up",
"temporary",
"yarn",
"address",
"reference",
":",
"{",
"}",
"\"",
",",
"yarn",
"properties",
"file",
"get",
"absolute",
"path",
"(",
")",
")",
";",
"yarn",
"properties",
"file",
"delete",
"(",
")",
";",
"}",
"}",
"catch",
"(",
"exception",
"e",
")",
"{",
"log",
"warn",
"(",
"\"",
"test",
"detached",
"per",
"job",
"yarn",
"cluster",
"internal",
":",
"exception",
"while",
"deleting",
"the",
"job",
"manager",
"address",
"file",
"\"",
",",
"e",
")",
";",
"}",
"}",
"log",
"info",
"(",
"\"",
"finished",
"test",
"detached",
"mode",
"(",
")",
"\"",
")",
";",
"}",
")",
";",
"}"
]
|
[
"fetch",
"database",
"name",
"from",
"connection",
"url"
]
| [
"protected",
"string",
"fetch",
"database",
"name",
"from",
"u",
"r",
"l",
"(",
"int",
"[",
"]",
"index",
"range",
")",
"{",
"return",
"url",
"substring",
"(",
"index",
"range",
"[",
"0",
"]",
",",
"index",
"range",
"[",
"1",
"]",
")",
";",
"}"
]
|
[
"setup",
"gridmix",
"for",
"emulation",
"of",
"distributed",
"cache",
"load",
"this",
"includes",
"generation",
"of",
"distributed",
"cache",
"files",
",",
"if",
"needed"
]
| [
"private",
"int",
"setup",
"dist",
"cache",
"emulation",
"(",
"configuration",
"conf",
",",
"string",
"trace",
"in",
",",
"path",
"io",
"path",
",",
"boolean",
"generate",
")",
"throws",
"i",
"o",
"exception",
",",
"interrupted",
"exception",
"{",
"dist",
"cache",
"emulator",
"init",
"(",
"trace",
"in",
",",
"factory",
"job",
"creator",
",",
"generate",
")",
";",
"int",
"exit",
"code",
"=",
"0",
";",
"if",
"(",
"dist",
"cache",
"emulator",
"should",
"generate",
"dist",
"cache",
"data",
"(",
")",
"|",
"|",
"dist",
"cache",
"emulator",
"should",
"emulate",
"dist",
"cache",
"load",
"(",
")",
")",
"{",
"job",
"story",
"producer",
"jsp",
"=",
"create",
"job",
"story",
"producer",
"(",
"trace",
"in",
",",
"conf",
")",
";",
"exit",
"code",
"=",
"dist",
"cache",
"emulator",
"setup",
"generate",
"dist",
"cache",
"data",
"(",
"jsp",
")",
";",
"if",
"(",
"exit",
"code",
"=",
"=",
"0",
")",
"{",
"/",
"/",
"if",
"there",
"are",
"files",
"to",
"be",
"generated",
",",
"run",
"a",
"map",
"reduce",
"job",
"to",
"generate",
"/",
"/",
"these",
"distributed",
"cache",
"files",
"of",
"all",
"the",
"simulated",
"jobs",
"of",
"this",
"trace",
"write",
"dist",
"cache",
"data",
"(",
"conf",
")",
";",
"}",
"}",
"return",
"exit",
"code",
";",
"}"
]
|
[
"get",
"a",
"self",
"-",
"renewing",
"azure",
"blob",
"lease",
"on",
"the",
"source",
"folder",
"zero",
"-",
"byte",
"file"
]
| [
"private",
"self",
"renewing",
"lease",
"lease",
"source",
"folder",
"(",
"string",
"src",
"key",
")",
"throws",
"azure",
"exception",
"{",
"return",
"store",
"acquire",
"lease",
"(",
"src",
"key",
")",
";",
"}"
]
|
[
"queues",
"a",
"task",
"to",
"dirty",
"the",
"nodes",
"named",
"by",
"{"
]
| [
"private",
"void",
"visit",
"(",
"iterable",
"<",
"sky",
"key",
">",
"keys",
",",
"final",
"invalidation",
"type",
"invalidation",
"type",
",",
"@",
"nullable",
"sky",
"key",
"enqueueing",
"key",
"for",
"existence",
"check",
")",
"{",
"/",
"/",
"code",
"from",
"here",
"until",
"pending",
"visitations",
"#",
"add",
"is",
"called",
"below",
"must",
"be",
"uninterruptible",
"boolean",
"is",
"changed",
"=",
"(",
"invalidation",
"type",
"=",
"=",
"invalidation",
"type",
"changed",
")",
";",
"set",
"<",
"sky",
"key",
">",
"set",
"to",
"check",
"=",
"is",
"changed",
"?",
"changed",
":",
"dirtied",
";",
"int",
"size",
"=",
"iterables",
"size",
"(",
"keys",
")",
";",
"array",
"list",
"<",
"sky",
"key",
">",
"keys",
"to",
"get",
"=",
"new",
"array",
"list",
"<",
">",
"(",
"size",
")",
";",
"for",
"(",
"sky",
"key",
"key",
":",
"keys",
")",
"{",
"if",
"(",
"set",
"to",
"check",
"add",
"(",
"key",
")",
")",
"{",
"preconditions",
"check",
"state",
"(",
"!",
"is",
"changed",
"|",
"|",
"key",
"function",
"name",
"(",
")",
"get",
"hermeticity",
"(",
")",
"!",
"=",
"function",
"hermeticity",
"hermetic",
",",
"key",
")",
";",
"keys",
"to",
"get",
"add",
"(",
"key",
")",
";",
"}",
"}",
"if",
"(",
"support",
"interruptions",
")",
"{",
"for",
"(",
"sky",
"key",
"key",
":",
"keys",
"to",
"get",
")",
"{",
"pending",
"visitations",
"add",
"(",
"pair",
"of",
"(",
"key",
",",
"invalidation",
"type",
")",
")",
";",
"}",
"}",
"final",
"map",
"<",
"sky",
"key",
",",
"?",
"extends",
"thin",
"node",
"entry",
">",
"entries",
";",
"try",
"{",
"entries",
"=",
"graph",
"get",
"batch",
"(",
"null",
",",
"reason",
"invalidation",
",",
"keys",
"to",
"get",
")",
";",
"}",
"catch",
"(",
"interrupted",
"exception",
"e",
")",
"{",
"thread",
"current",
"thread",
"(",
")",
"interrupt",
"(",
")",
";",
"/",
"/",
"this",
"can",
"only",
"happen",
"if",
"the",
"main",
"thread",
"has",
"been",
"interrupted",
",",
"and",
"so",
"the",
"/",
"/",
"abstract",
"queue",
"visitor",
"is",
"shutting",
"down",
"we",
"haven",
"'",
"t",
"yet",
"removed",
"the",
"pending",
"visitations",
",",
"so",
"/",
"/",
"we",
"can",
"resume",
"next",
"time",
"return",
";",
"}",
"if",
"(",
"enqueueing",
"key",
"for",
"existence",
"check",
"!",
"=",
"null",
"&",
"&",
"entries",
"size",
"(",
")",
"!",
"=",
"keys",
"to",
"get",
"size",
"(",
")",
")",
"{",
"set",
"<",
"sky",
"key",
">",
"missing",
"keys",
"=",
"sets",
"difference",
"(",
"immutable",
"set",
"copy",
"of",
"(",
"keys",
"to",
"get",
")",
",",
"entries",
"key",
"set",
"(",
")",
")",
";",
"throw",
"new",
"illegal",
"state",
"exception",
"(",
"string",
"format",
"(",
"\"",
"key",
"(",
"s",
")",
"%",
"s",
"not",
"in",
"the",
"graph",
",",
"but",
"enqueued",
"for",
"dirtying",
"by",
"%",
"s",
"\"",
",",
"iterables",
"limit",
"(",
"missing",
"keys",
",",
"10",
")",
",",
"enqueueing",
"key",
"for",
"existence",
"check",
")",
")",
";",
"}",
"/",
"/",
"we",
"take",
"a",
"deeper",
"thread",
"stack",
"in",
"exchange",
"for",
"less",
"contention",
"in",
"the",
"executor",
"int",
"last",
"index",
"=",
"keys",
"to",
"get",
"size",
"(",
")",
"-",
"1",
";",
"if",
"(",
"last",
"index",
"=",
"=",
"-",
"1",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"last",
"index",
";",
"i",
"+",
"+",
")",
"{",
"sky",
"key",
"key",
"=",
"keys",
"to",
"get",
"get",
"(",
"i",
")",
";",
"executor",
"execute",
"(",
"(",
")",
"-",
">",
"dirty",
"key",
"and",
"visit",
"parents",
"(",
"key",
",",
"entries",
",",
"invalidation",
"type",
")",
")",
";",
"}",
"if",
"(",
"!",
"thread",
"interrupted",
"(",
")",
")",
"{",
"/",
"/",
"emulate",
"what",
"would",
"happen",
"if",
"we",
"'",
"d",
"submitted",
"this",
"to",
"the",
"executor",
":",
"skip",
"on",
"interrupt",
"dirty",
"key",
"and",
"visit",
"parents",
"(",
"keys",
"to",
"get",
"get",
"(",
"last",
"index",
")",
",",
"entries",
",",
"invalidation",
"type",
")",
";",
"}",
"}"
]
|
[
"helper",
"function",
"for",
"adding",
"or",
"type",
"queries",
"for",
"a",
"given",
"identity",
"field",
"the",
"filter",
"consists",
"of",
"should",
"clauses",
"(",
"i",
"e",
"\"",
"or",
"\"",
"boolean",
"queries",
")",
"-",
"when",
"a",
"token",
"is",
"a",
"wildcard",
"token",
",",
"a",
"wildcard",
"query",
"is",
"added",
"-",
"when",
"a",
"token",
"is",
"not",
"a",
"wildcard",
",",
"a",
"term",
"query",
"is",
"added"
]
| [
"public",
"static",
"optional",
"<",
"query",
"builder",
">",
"build",
"token",
"filter",
"query",
"(",
"string",
"identity",
"field",
",",
"string",
"[",
"]",
"tokens",
")",
"{",
"if",
"(",
"strings",
"is",
"all",
"or",
"wildcard",
"(",
"tokens",
")",
")",
"{",
"return",
"optional",
"empty",
"(",
")",
";",
"}",
"bool",
"query",
"builder",
"should",
"queries",
"=",
"new",
"bool",
"query",
"builder",
"(",
")",
";",
"list",
"<",
"string",
">",
"terms",
"=",
"new",
"array",
"list",
"<",
">",
"(",
")",
";",
"for",
"(",
"string",
"token",
":",
"tokens",
")",
"{",
"if",
"(",
"regex",
"is",
"simple",
"match",
"pattern",
"(",
"token",
")",
")",
"{",
"should",
"queries",
"should",
"(",
"new",
"wildcard",
"query",
"builder",
"(",
"identity",
"field",
",",
"token",
")",
")",
";",
"}",
"else",
"{",
"terms",
"add",
"(",
"token",
")",
";",
"}",
"}",
"if",
"(",
"terms",
"is",
"empty",
"(",
")",
"=",
"=",
"false",
")",
"{",
"should",
"queries",
"should",
"(",
"new",
"terms",
"query",
"builder",
"(",
"identity",
"field",
",",
"terms",
")",
")",
";",
"}",
"if",
"(",
"should",
"queries",
"should",
"(",
")",
"is",
"empty",
"(",
")",
")",
"{",
"return",
"optional",
"empty",
"(",
")",
";",
"}",
"return",
"optional",
"of",
"(",
"should",
"queries",
")",
";",
"}"
]
|
[
"returns",
"whether",
"the",
"given",
"variables",
"are",
"never",
"alive",
"at",
"the",
"same",
"time"
]
| [
"private",
"boolean",
"are",
"non",
"overlapping",
"(",
"int",
"variable",
"index",
"1",
",",
"int",
"variable",
"index",
"2",
",",
"int",
"code",
"length",
")",
"{",
"/",
"/",
"loop",
"over",
"all",
"instructions",
"for",
"(",
"int",
"offset",
"=",
"0",
";",
"offset",
"<",
"code",
"length",
";",
"offset",
"+",
"+",
")",
"{",
"if",
"(",
"(",
"liveness",
"analyzer",
"is",
"alive",
"before",
"(",
"offset",
",",
"variable",
"index",
"1",
")",
"&",
"&",
"liveness",
"analyzer",
"is",
"alive",
"before",
"(",
"offset",
",",
"variable",
"index",
"2",
")",
")",
"|",
"|",
"(",
"liveness",
"analyzer",
"is",
"alive",
"after",
"(",
"offset",
",",
"variable",
"index",
"1",
")",
"&",
"&",
"liveness",
"analyzer",
"is",
"alive",
"after",
"(",
"offset",
",",
"variable",
"index",
"2",
")",
")",
"|",
"|",
"/",
"/",
"for",
"now",
",",
"exclude",
"category",
"2",
"variables",
"liveness",
"analyzer",
"is",
"category",
"2",
"(",
"offset",
",",
"variable",
"index",
"1",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"true",
";",
"}"
]
|
[
"creates",
"a",
"{",
"@",
"link",
"map",
"}",
"of",
"painless",
"method",
"keys",
"to",
"{",
"@",
"link",
"painless",
"method",
"}",
"s",
"per",
"{",
"@",
"link",
"painless",
"class",
"}",
"stored",
"as",
"{",
"@",
"link",
"painless",
"class",
"#",
"runtime",
"methods",
"}",
"identical",
"to",
"{",
"@",
"link",
"painless",
"class",
"#",
"methods",
"}",
"with",
"the",
"exception",
"of",
"generated",
"bridge",
"methods",
"a",
"generated",
"bridge",
"method",
"is",
"created",
"for",
"each",
"whitelisted",
"method",
"that",
"has",
"at",
"least",
"one",
"parameter",
"with",
"a",
"boxed",
"type",
"to",
"cast",
"from",
"other",
"numeric",
"primitiveboxed",
"types",
"in",
"a",
"symmetric",
"was",
"not",
"handled",
"by",
"{",
"@",
"link",
"method",
"handle",
"#",
"as",
"type",
"(",
"method",
"type",
")",
"}",
"as",
"an",
"example",
"{",
"@",
"link",
"method",
"handle",
"#",
"as",
"type",
"(",
"method",
"type",
")",
"}",
"legally",
"casts",
"from",
"{",
"@",
"link",
"integer",
"}",
"to",
"long",
"but",
"not",
"from",
"int",
"to",
"{",
"@",
"link",
"long",
"}",
"generated",
"bridge",
"methods",
"cover",
"the",
"latter",
"case",
"a",
"generated",
"bridge",
"method",
"replaces",
"the",
"method",
"its",
"a",
"bridge",
"to",
"in",
"the",
"{",
"@",
"link",
"painless",
"class",
"#",
"runtime",
"methods",
"}",
"{",
"@",
"link",
"map",
"}",
"the",
"{",
"@",
"link",
"painless",
"class",
"#",
"runtime",
"methods",
"}",
"{",
"@",
"link",
"map",
"}",
"is",
"used",
"exclusively",
"to",
"look",
"up",
"methods",
"at",
"run",
"-",
"time",
"resulting",
"from",
"calls",
"with",
"a",
"def",
"type",
"value",
"target"
]
| [
"private",
"void",
"generate",
"runtime",
"methods",
"(",
")",
"{",
"for",
"(",
"painless",
"class",
"builder",
"painless",
"class",
"builder",
":",
"classes",
"to",
"painless",
"class",
"builders",
"values",
"(",
")",
")",
"{",
"painless",
"class",
"builder",
"runtime",
"methods",
"put",
"all",
"(",
"painless",
"class",
"builder",
"methods",
")",
";",
"for",
"(",
"painless",
"method",
"painless",
"method",
":",
"painless",
"class",
"builder",
"runtime",
"methods",
"values",
"(",
")",
")",
"{",
"for",
"(",
"class",
"<",
"?",
">",
"type",
"parameter",
":",
"painless",
"method",
"type",
"parameters",
")",
"{",
"if",
"(",
"type",
"parameter",
"=",
"=",
"byte",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"short",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"character",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"integer",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"long",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"float",
"class",
"|",
"|",
"type",
"parameter",
"=",
"=",
"double",
"class",
")",
"{",
"generate",
"bridge",
"method",
"(",
"painless",
"class",
"builder",
",",
"painless",
"method",
")",
";",
"}",
"}",
"}",
"}",
"}"
]
|
[
"closes",
"current",
"reader",
"and",
"creates",
"new",
"one",
"with",
"new",
"checkoint",
"and",
"same",
"file",
"channel"
]
| [
"translog",
"reader",
"close",
"into",
"trimmed",
"reader",
"(",
"long",
"above",
"seq",
"no",
",",
"channel",
"factory",
"channel",
"factory",
")",
"throws",
"i",
"o",
"exception",
"{",
"if",
"(",
"closed",
"compare",
"and",
"set",
"(",
"false",
",",
"true",
")",
")",
"{",
"closeable",
"to",
"close",
"on",
"failure",
"=",
"channel",
";",
"final",
"translog",
"reader",
"new",
"reader",
";",
"try",
"{",
"if",
"(",
"above",
"seq",
"no",
"<",
"checkpoint",
"trimmed",
"above",
"seq",
"no",
"|",
"|",
"above",
"seq",
"no",
"<",
"checkpoint",
"max",
"seq",
"no",
"&",
"&",
"checkpoint",
"trimmed",
"above",
"seq",
"no",
"=",
"=",
"sequence",
"numbers",
"unassigned",
"seq",
"no",
")",
"{",
"final",
"path",
"checkpoint",
"file",
"=",
"path",
"get",
"parent",
"(",
")",
"resolve",
"(",
"get",
"commit",
"checkpoint",
"file",
"name",
"(",
"checkpoint",
"generation",
")",
")",
";",
"final",
"checkpoint",
"new",
"checkpoint",
"=",
"new",
"checkpoint",
"(",
"checkpoint",
"offset",
",",
"checkpoint",
"num",
"ops",
",",
"checkpoint",
"generation",
",",
"checkpoint",
"min",
"seq",
"no",
",",
"checkpoint",
"max",
"seq",
"no",
",",
"checkpoint",
"global",
"checkpoint",
",",
"checkpoint",
"min",
"translog",
"generation",
",",
"above",
"seq",
"no",
")",
";",
"checkpoint",
"write",
"(",
"channel",
"factory",
",",
"checkpoint",
"file",
",",
"new",
"checkpoint",
",",
"standard",
"open",
"option",
"write",
")",
";",
"i",
"o",
"utils",
"fsync",
"(",
"checkpoint",
"file",
"get",
"parent",
"(",
")",
",",
"true",
")",
";",
"new",
"reader",
"=",
"new",
"translog",
"reader",
"(",
"new",
"checkpoint",
",",
"channel",
",",
"path",
",",
"header",
")",
";",
"}",
"else",
"{",
"new",
"reader",
"=",
"new",
"translog",
"reader",
"(",
"checkpoint",
",",
"channel",
",",
"path",
",",
"header",
")",
";",
"}",
"to",
"close",
"on",
"failure",
"=",
"null",
";",
"return",
"new",
"reader",
";",
"}",
"finally",
"{",
"i",
"o",
"utils",
"close",
"(",
"to",
"close",
"on",
"failure",
")",
";",
"}",
"}",
"else",
"{",
"throw",
"new",
"already",
"closed",
"exception",
"(",
"to",
"string",
"(",
")",
"+",
"\"",
"is",
"already",
"closed",
"\"",
")",
";",
"}",
"}"
]
|
[
"variance",
",",
"sigma",
"^",
"2"
]
| [
"public",
"double",
"get",
"variance",
"(",
")",
"{",
"return",
"n",
">",
"0",
"?",
"(",
"m",
"2",
"/",
"(",
"n",
"-",
"1",
")",
")",
":",
"0",
";",
"}"
]
|
[
"returns",
"the",
"data",
"element",
"at",
"the",
"specified",
"index",
"in",
"this",
"skip",
"list"
]
| [
"public",
"directory",
"diff",
"get",
"(",
"int",
"index",
")",
"{",
"return",
"skip",
"node",
"list",
"get",
"(",
"index",
")",
"get",
"diff",
"(",
")",
";",
"}"
]
|
[
"copies",
"this",
"file",
"or",
"directory",
"to",
"the",
"specified",
"file",
"or",
"directory",
"if",
"this",
"handle",
"is",
"a",
"file",
",",
"then",
"1",
")",
"if",
"the",
"destination",
"is",
"a",
"file",
",",
"it",
"is",
"overwritten",
",",
"or",
"2",
")",
"if",
"the",
"destination",
"is",
"a",
"directory",
",",
"this",
"file",
"is",
"copied",
"into",
"it",
",",
"or",
"3",
")",
"if",
"the",
"destination",
"doesn",
"'",
"t",
"exist",
",",
"{",
"@",
"link",
"#",
"mkdirs",
"(",
")",
"}",
"is",
"called",
"on",
"the",
"destination",
"'",
"s",
"parent",
"and",
"this",
"file",
"is",
"copied",
"into",
"it",
"with",
"a",
"new",
"name",
"if",
"this",
"handle",
"is",
"a",
"directory",
",",
"then",
"1",
")",
"if",
"the",
"destination",
"is",
"a",
"file",
",",
"gdx",
"runtime",
"exception",
"is",
"thrown",
",",
"or",
"2",
")",
"if",
"the",
"destination",
"is",
"a",
"directory",
",",
"this",
"directory",
"is",
"copied",
"into",
"it",
"recursively",
",",
"overwriting",
"existing",
"files",
",",
"or",
"3",
")",
"if",
"the",
"destination",
"doesn",
"'",
"t",
"exist",
",",
"{",
"@",
"link",
"#",
"mkdirs",
"(",
")",
"}",
"is",
"called",
"on",
"the",
"destination",
"and",
"this",
"directory",
"is",
"copied",
"into",
"it",
"recursively"
]
| [
"public",
"void",
"copy",
"to",
"(",
"file",
"handle",
"dest",
")",
"{",
"if",
"(",
"!",
"is",
"directory",
"(",
")",
")",
"{",
"if",
"(",
"dest",
"is",
"directory",
"(",
")",
")",
"dest",
"=",
"dest",
"child",
"(",
"name",
"(",
")",
")",
";",
"copy",
"file",
"(",
"this",
",",
"dest",
")",
";",
"return",
";",
"}",
"if",
"(",
"dest",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"!",
"dest",
"is",
"directory",
"(",
")",
")",
"throw",
"new",
"gdx",
"runtime",
"exception",
"(",
"\"",
"destination",
"exists",
"but",
"is",
"not",
"a",
"directory",
":",
"\"",
"+",
"dest",
")",
";",
"}",
"else",
"{",
"dest",
"mkdirs",
"(",
")",
";",
"if",
"(",
"!",
"dest",
"is",
"directory",
"(",
")",
")",
"throw",
"new",
"gdx",
"runtime",
"exception",
"(",
"\"",
"destination",
"directory",
"cannot",
"be",
"created",
":",
"\"",
"+",
"dest",
")",
";",
"}",
"copy",
"directory",
"(",
"this",
",",
"dest",
"child",
"(",
"name",
"(",
")",
")",
")",
";",
"}"
]
|
[
"resolve",
"registered",
"service",
"in",
"request",
"context"
]
| [
"protected",
"registered",
"service",
"resolve",
"registered",
"service",
"in",
"request",
"context",
"(",
"final",
"request",
"context",
"request",
"context",
")",
"{",
"val",
"resolved",
"service",
"=",
"resolve",
"service",
"from",
"authentication",
"request",
"(",
"request",
"context",
")",
";",
"if",
"(",
"resolved",
"service",
"!",
"=",
"null",
")",
"{",
"val",
"service",
"=",
"get",
"webflow",
"event",
"resolution",
"configuration",
"context",
"(",
")",
"get",
"services",
"manager",
"(",
")",
"find",
"service",
"by",
"(",
"resolved",
"service",
")",
";",
"registered",
"service",
"access",
"strategy",
"utils",
"ensure",
"service",
"access",
"is",
"allowed",
"(",
"resolved",
"service",
",",
"service",
")",
";",
"return",
"service",
";",
"}",
"logger",
"debug",
"(",
"\"",
"authentication",
"request",
"is",
"not",
"accompanied",
"by",
"a",
"service",
"given",
"none",
"is",
"specified",
"\"",
")",
";",
"return",
"null",
";",
"}"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.