docstring_tokens
list
code_tokens
list
[ "add", "one", "or", "more", "{", "@", "code", "request", "body", "advice", "}", "instances", "to", "intercept", "the", "request", "before", "it", "is", "read", "and", "converted", "for", "{", "@", "code", "@", "request", "body", "}", "and", "{", "@", "code", "http", "entity", "}", "method", "arguments" ]
[ "public", "void", "set", "request", "body", "advice", "(", "@", "nullable", "list", "<", "request", "body", "advice", ">", "request", "body", "advice", ")", "{", "if", "(", "request", "body", "advice", "!", "=", "null", ")", "{", "this", "request", "response", "body", "advice", "add", "all", "(", "request", "body", "advice", ")", ";", "}", "}" ]
[ "create", "a", "new", "object", "metadata", "instance", "any", "standard", "metadata", "headers", "are", "added", "here", ",", "for", "example", ":", "encryption" ]
[ "public", "object", "metadata", "new", "object", "metadata", "(", "long", "length", ")", "{", "final", "object", "metadata", "om", "=", "new", "object", "metadata", "(", ")", ";", "if", "(", "length", ">", "=", "0", ")", "{", "om", "set", "content", "length", "(", "length", ")", ";", "}", "return", "om", ";", "}" ]
[ "tests", "that", "n", "h", "m", "w", "e", "s", "makes", "hash", "maps", "large", "enough", "that", "adding", "the", "expected", "number", "of", "elements", "won", "'", "t", "cause", "a", "rehash", "as", "of", "jdk", "7u", "4", "0", ",", "hash", "map", "has", "an", "empty", "-", "map", "optimization", "the", "argument", "to", "new", "hash", "map", "(", "int", ")", "is", "noted", ",", "but", "the", "initial", "table", "is", "a", "zero", "-", "length", "array", "this", "test", "may", "fail", "miserably", "on", "non", "-", "open", "j", "d", "k", "environments" ]
[ "public", "void", "test", "new", "hash", "map", "with", "expected", "size", "wont", "grow", "(", ")", "throws", "exception", "{", "/", "/", "before", "jdk", "7u", "4", "0", ":", "creates", "one", "-", "bucket", "table", "/", "/", "after", "jdk", "7u", "4", "0", ":", "creates", "empty", "table", "assert", "true", "(", "buckets", "of", "(", "maps", "new", "hash", "map", "with", "expected", "size", "(", "0", ")", ")", "<", "=", "1", ")", ";", "for", "(", "int", "size", "=", "1", ";", "size", "<", "200", ";", "size", "+", "+", ")", "{", "assert", "wont", "grow", "(", "size", ",", "maps", "new", "hash", "map", "with", "expected", "size", "(", "size", ")", ",", "maps", "new", "hash", "map", "with", "expected", "size", "(", "size", ")", ")", ";", "}", "}" ]
[ "try", "to", "set", "up", "the", "response", "to", "indicate", "that", "the", "client", "version", "is", "incompatible", "with", "the", "server", "this", "can", "contain", "special", "-", "case", "code", "to", "speak", "enough", "of", "past", "ipc", "protocols", "to", "pass", "back", "an", "exception", "to", "the", "caller" ]
[ "private", "void", "setup", "bad", "version", "response", "(", "int", "client", "version", ")", "throws", "i", "o", "exception", "{", "string", "err", "msg", "=", "\"", "server", "ipc", "version", "\"", "+", "current", "version", "+", "\"", "cannot", "communicate", "with", "client", "version", "\"", "+", "client", "version", ";", "byte", "array", "output", "stream", "buffer", "=", "new", "byte", "array", "output", "stream", "(", ")", ";", "if", "(", "client", "version", ">", "=", "9", ")", "{", "/", "/", "versions", ">", ">", "9", "understand", "the", "normal", "response", "rpc", "call", "fake", "call", "=", "new", "rpc", "call", "(", "this", ",", "-", "1", ")", ";", "setup", "response", "(", "fake", "call", ",", "rpc", "status", "proto", "fatal", ",", "rpc", "error", "code", "proto", "fatal", "version", "mismatch", ",", "null", ",", "version", "mismatch", "class", "get", "name", "(", ")", ",", "err", "msg", ")", ";", "send", "response", "(", "fake", "call", ")", ";", "}", "else", "if", "(", "client", "version", ">", "=", "3", ")", "{", "rpc", "call", "fake", "call", "=", "new", "rpc", "call", "(", "this", ",", "-", "1", ")", ";", "/", "/", "versions", "3", "to", "8", "use", "older", "response", "setup", "response", "old", "version", "fatal", "(", "buffer", ",", "fake", "call", ",", "null", ",", "version", "mismatch", "class", "get", "name", "(", ")", ",", "err", "msg", ")", ";", "send", "response", "(", "fake", "call", ")", ";", "}", "else", "if", "(", "client", "version", "=", "=", "2", ")", "{", "/", "/", "hadoop", "0", "18", "3", "rpc", "call", "fake", "call", "=", "new", "rpc", "call", "(", "this", ",", "0", ")", ";", "data", "output", "stream", "out", "=", "new", "data", "output", "stream", "(", "buffer", ")", ";", "out", "write", "int", "(", "0", ")", ";", "/", "/", "call", "id", "out", "write", "boolean", "(", "true", ")", ";", "/", "/", "error", "writable", "utils", "write", "string", "(", "out", ",", "version", "mismatch", "class", "get", "name", "(", ")", ")", ";", "writable", "utils", "write", "string", "(", "out", ",", "err", "msg", ")", ";", "fake", "call", "set", "response", "(", "byte", "buffer", "wrap", "(", "buffer", "to", "byte", "array", "(", ")", ")", ")", ";", "send", "response", "(", "fake", "call", ")", ";", "}", "}" ]
[ "program", "entry", "point" ]
[ "public", "static", "void", "main", "(", "final", "string", "args", ")", "{", "/", "*", "create", "new", "data", "mapper", "for", "type", "'", "first", "'", "*", "/", "final", "var", "mapper", "=", "new", "student", "data", "mapper", "impl", "(", ")", ";", "/", "*", "create", "new", "student", "*", "/", "var", "student", "=", "new", "student", "(", "1", ",", "\"", "adam", "\"", ",", "'", "a", "'", ")", ";", "/", "*", "add", "student", "in", "respectibe", "store", "*", "/", "mapper", "insert", "(", "student", ")", ";", "log", "debug", "(", "student", "string", "+", "student", "+", "\"", ",", "is", "inserted", "\"", ")", ";", "/", "*", "find", "this", "student", "*", "/", "final", "var", "student", "to", "be", "found", "=", "mapper", "find", "(", "student", "get", "student", "id", "(", ")", ")", ";", "log", "debug", "(", "student", "string", "+", "student", "to", "be", "found", "+", "\"", ",", "is", "searched", "\"", ")", ";", "/", "*", "update", "existing", "student", "object", "*", "/", "student", "=", "new", "student", "(", "student", "get", "student", "id", "(", ")", ",", "\"", "adam", "updated", "\"", ",", "'", "a", "'", ")", ";", "/", "*", "update", "student", "in", "respectibe", "db", "*", "/", "mapper", "update", "(", "student", ")", ";", "log", "debug", "(", "student", "string", "+", "student", "+", "\"", ",", "is", "updated", "\"", ")", ";", "log", "debug", "(", "student", "string", "+", "student", "+", "\"", ",", "is", "going", "to", "be", "deleted", "\"", ")", ";", "/", "*", "delete", "student", "in", "db", "*", "/", "mapper", "delete", "(", "student", ")", ";", "}" ]
[ "convert", "the", "given", "object", "to", "string", "with", "each", "line", "indented", "by", "4", "spaces", "(", "except", "the", "first", "line", ")" ]
[ "private", "static", "string", "to", "indented", "string", "(", "object", "o", ")", "{", "if", "(", "o", "=", "=", "null", ")", "{", "return", "\"", "null", "\"", ";", "}", "return", "o", "to", "string", "(", ")", "replace", "(", "\"", "\\", "n", "\"", ",", "\"", "\\", "n", "\"", ")", ";", "}" ]
[ "<", "code", ">", "optional", "aapt", "pb", "source", "position", "position", "=", "2", ";", "<", "code", ">" ]
[ "public", "builder", "merge", "position", "(", "com", "android", "aapt", "resources", "source", "position", "value", ")", "{", "copy", "on", "write", "(", ")", ";", "instance", "merge", "position", "(", "value", ")", ";", "return", "this", ";", "}" ]
[ "get", "petfind", "by", "tags", ":", "finds", "pets", "by", "tags", "multiple", "tags", "can", "be", "provided", "with", "comma", "separated", "strings", "use", "tag", "1", ",", "tag", "2", ",", "tag", "3", "for", "testing" ]
[ "default", "response", "entity", "<", "set", "<", "pet", ">", ">", "find", "pets", "by", "tags", "(", "@", "not", "null", "@", "api", "param", "(", "value", "=", "\"", "tags", "to", "filter", "by", "\"", ",", "required", "=", "true", ")", "@", "valid", "@", "request", "param", "(", "value", "=", "\"", "tags", "\"", ",", "required", "=", "true", ")", "set", "<", "string", ">", "tags", ")", "{", "get", "request", "(", ")", "if", "present", "(", "request", "-", ">", "{", "for", "(", "media", "type", "media", "type", ":", "media", "type", "parse", "media", "types", "(", "request", "get", "header", "(", "\"", "accept", "\"", ")", ")", ")", "{", "if", "(", "media", "type", "is", "compatible", "with", "(", "media", "type", "value", "of", "(", "\"", "application", "/", "json", "\"", ")", ")", ")", "{", "string", "example", "string", "=", "\"", "{", "\\", "\"", "photo", "urls", "\\", "\"", ":", "[", "\\", "\"", "photo", "urls", "\\", "\"", ",", "\\", "\"", "photo", "urls", "\\", "\"", "]", ",", "\\", "\"", "name", "\\", "\"", ":", "\\", "\"", "doggie", "\\", "\"", ",", "\\", "\"", "id", "\\", "\"", ":", "0", ",", "\\", "\"", "category", "\\", "\"", ":", "{", "\\", "\"", "name", "\\", "\"", ":", "\\", "\"", "default", "-", "name", "\\", "\"", ",", "\\", "\"", "id", "\\", "\"", ":", "6", "}", ",", "\\", "\"", "tags", "\\", "\"", ":", "[", "{", "\\", "\"", "name", "\\", "\"", ":", "\\", "\"", "name", "\\", "\"", ",", "\\", "\"", "id", "\\", "\"", ":", "1", "}", ",", "{", "\\", "\"", "name", "\\", "\"", ":", "\\", "\"", "name", "\\", "\"", ",", "\\", "\"", "id", "\\", "\"", ":", "1", "}", "]", ",", "\\", "\"", "status", "\\", "\"", ":", "\\", "\"", "available", "\\", "\"", "}", "\"", ";", "api", "util", "set", "example", "response", "(", "request", ",", "\"", "application", "/", "json", "\"", ",", "example", "string", ")", ";", "break", ";", "}", "if", "(", "media", "type", "is", "compatible", "with", "(", "media", "type", "value", "of", "(", "\"", "application", "/", "xml", "\"", ")", ")", ")", "{", "string", "example", "string", "=", "\"", "<", "pet", ">", "<", "id", ">", "123456789", "<", "/", "id", ">", "<", "name", ">", "doggie", "<", "/", "name", ">", "<", "photo", "urls", ">", "<", "photo", "urls", ">", "aeiou", "<", "/", "photo", "urls", ">", "<", "/", "photo", "urls", ">", "<", "tags", ">", "<", "/", "tags", ">", "<", "status", ">", "aeiou", "<", "/", "status", ">", "<", "/", "pet", ">", "\"", ";", "api", "util", "set", "example", "response", "(", "request", ",", "\"", "application", "/", "xml", "\"", ",", "example", "string", ")", ";", "break", ";", "}", "}", "}", ")", ";", "return", "new", "response", "entity", "<", ">", "(", "http", "status", "not", "implemented", ")", ";", "}" ]
[ "return", "the", "underlying", "jetty", "{", "@", "code", "web", "socket", "client", "}" ]
[ "public", "org", "eclipse", "jetty", "websocket", "client", "web", "socket", "client", "get", "jetty", "client", "(", ")", "{", "return", "this", "jetty", "client", ";", "}" ]
[ "returns", "the", "set", "of", "constraint", "violations", "in", "the", "configuration" ]
[ "public", "set", "<", "constraint", "violation", "<", "?", ">", ">", "get", "constraint", "violations", "(", ")", "{", "return", "constraint", "violations", ";", "}" ]
[ "find", "the", "fields", "constant", "that", "matches", "field", "id", ",", "throwing", "an", "exception", "if", "it", "is", "not", "found" ]
[ "public", "static", "fields", "find", "by", "thrift", "id", "or", "throw", "(", "int", "field", "id", ")", "{", "fields", "fields", "=", "find", "by", "thrift", "id", "(", "field", "id", ")", ";", "if", "(", "fields", "=", "=", "null", ")", "throw", "new", "illegal", "argument", "exception", "(", "\"", "field", "\"", "+", "field", "id", "+", "\"", "doesn", "'", "t", "exist", "!", "\"", ")", ";", "return", "fields", ";", "}" ]
[ "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", "\"", ")", ";", "}" ]
[ "test", "the", "property", "'", "declawed", "'" ]
[ "public", "void", "declawed", "test", "(", ")", "{", "/", "/", "todo", ":", "test", "declawed", "}" ]
[ "emits", "a", "name", "like", "{", "@", "code", "java", "lang", "string", "}", "or", "{", "@", "code", "java", "util", "list", "<", "java", "lang", "string", ">", "}", ",", "shorting", "it", "with", "imports", "if", "possible" ]
[ "private", "void", "type", "(", "string", "type", ")", "throws", "i", "o", "exception", "{", "if", "(", "this", "package", "prefix", "=", "=", "null", ")", "{", "throw", "new", "illegal", "state", "exception", "(", ")", ";", "}", "matcher", "m", "=", "type", "pattern", "matcher", "(", "type", ")", ";", "int", "pos", "=", "0", ";", "while", "(", "true", ")", "{", "boolean", "found", "=", "m", "find", "(", "pos", ")", ";", "/", "/", "copy", "non", "-", "matching", "characters", "like", "\"", "<", "\"", "int", "type", "start", "=", "found", "?", "m", "start", "(", ")", ":", "type", "length", "(", ")", ";", "out", "write", "(", "type", ",", "pos", ",", "type", "start", "-", "pos", ")", ";", "if", "(", "!", "found", ")", "{", "break", ";", "}", "/", "/", "copy", "a", "single", "class", "name", ",", "shortening", "it", "if", "possible", "string", "name", "=", "m", "group", "(", "0", ")", ";", "string", "imported", ";", "if", "(", "(", "imported", "=", "imported", "types", "get", "(", "name", ")", ")", "!", "=", "null", ")", "{", "out", "write", "(", "imported", ")", ";", "}", "else", "if", "(", "name", "starts", "with", "(", "package", "prefix", ")", "&", "&", "name", "index", "of", "(", "'", "'", ",", "package", "prefix", "length", "(", ")", ")", "=", "=", "-", "1", ")", "{", "out", "write", "(", "name", "substring", "(", "package", "prefix", "length", "(", ")", ")", ")", ";", "}", "else", "if", "(", "name", "starts", "with", "(", "\"", "java", "lang", "\"", ")", ")", "{", "out", "write", "(", "name", "substring", "(", "\"", "java", "lang", "\"", "length", "(", ")", ")", ")", ";", "}", "else", "{", "out", "write", "(", "name", ")", ";", "}", "pos", "=", "m", "end", "(", ")", ";", "}", "}" ]
[ "send", "a", "heartbeat", "to", "the", "name", "-", "node", "ignore", "reply", "commands" ]
[ "void", "send", "heartbeat", "(", ")", "throws", "i", "o", "exception", "{", "/", "/", "register", "datanode", "/", "/", "todo", ":", "federation", "currently", "a", "single", "block", "pool", "is", "supported", "storage", "report", "[", "]", "rep", "=", "{", "new", "storage", "report", "(", "storage", ",", "false", ",", "df", "capacity", ",", "df", "used", ",", "df", "capacity", "-", "df", "used", ",", "df", "used", ",", "0l", ")", "}", ";", "datanode", "command", "[", "]", "cmds", "=", "data", "node", "proto", "send", "heartbeat", "(", "dn", "registration", ",", "rep", ",", "0l", ",", "0l", ",", "0", ",", "0", ",", "0", ",", "null", ",", "true", ",", "slow", "peer", "reports", "empty", "report", ",", "slow", "disk", "reports", "empty", "report", ")", "get", "commands", "(", ")", ";", "if", "(", "cmds", "!", "=", "null", ")", "{", "for", "(", "datanode", "command", "cmd", ":", "cmds", ")", "{", "if", "(", "log", "is", "debug", "enabled", "(", ")", ")", "{", "log", "debug", "(", "\"", "send", "heartbeat", "name", "-", "node", "reply", ":", "\"", "+", "cmd", "get", "action", "(", ")", ")", ";", "}", "}", "}", "}" ]
[ "must", "be", "called", "before", "ignite", "(", ")", "must", "be", "it", "'", "s", "own", "default", "method", "to", "maintain", "backwards", "compatibility", "move", "to", "ignite", "method", "in", "3", "0" ]
[ "default", "void", "trust", "forward", "headers", "(", "boolean", "trust", ")", "{", "}" ]
[ "returns", "the", "{", "@", "link", "data", "type", "}", "associated", "with", "this", "applierwrapper" ]
[ "data", "type", "get", "data", "type", "(", ")", "{", "if", "(", "resolved", ")", "{", "return", "resolved", "data", "type", ";", "}", "return", "data", "type", ";", "}" ]
[ "{", "@", "inherit", "doc", "}", "note", ":", "list", "status", "on", "root", "(", "\"", "\"", ")", "considers", "listing", "from", "fallback", "link", "if", "available", "if", "the", "same", "directory", "name", "is", "present", "in", "configured", "mount", "path", "as", "well", "as", "in", "fallback", "link", ",", "then", "only", "the", "configured", "mount", "path", "will", "be", "listed", "in", "the", "returned", "result" ]
[ "public", "file", "status", "[", "]", "list", "status", "(", "final", "path", "f", ")", "throws", "i", "o", "exception", "{", "check", "path", "is", "slash", "(", "f", ")", ";", "file", "status", "[", "]", "fallback", "statuses", "=", "list", "status", "for", "fallback", "link", "(", ")", ";", "set", "<", "file", "status", ">", "link", "statuses", "=", "new", "hash", "set", "<", ">", "(", ")", ";", "set", "<", "file", "status", ">", "internal", "dir", "statuses", "=", "new", "hash", "set", "<", ">", "(", ")", ";", "int", "i", "=", "0", ";", "for", "(", "entry", "<", "string", ",", "i", "node", "<", "abstract", "file", "system", ">", ">", "i", "entry", ":", "the", "internal", "dir", "get", "children", "(", ")", "entry", "set", "(", ")", ")", "{", "i", "node", "<", "abstract", "file", "system", ">", "inode", "=", "i", "entry", "get", "value", "(", ")", ";", "path", "path", "=", "new", "path", "(", "inode", "full", "path", ")", "make", "qualified", "(", "my", "uri", ",", "null", ")", ";", "if", "(", "inode", "is", "link", "(", ")", ")", "{", "i", "node", "link", "<", "abstract", "file", "system", ">", "link", "=", "(", "i", "node", "link", "<", "abstract", "file", "system", ">", ")", "inode", ";", "if", "(", "show", "mount", "links", "as", "symlinks", ")", "{", "/", "/", "to", "maintain", "backward", "compatibility", ",", "with", "default", "option", "(", "showing", "/", "/", "mount", "links", "as", "symlinks", ")", ",", "we", "will", "represent", "target", "link", "as", "/", "/", "symlink", "and", "rest", "other", "properties", "are", "belongs", "to", "mount", "link", "only", "link", "statuses", "add", "(", "new", "file", "status", "(", "0", ",", "false", ",", "0", ",", "0", ",", "creation", "time", ",", "creation", "time", ",", "permission", "555", ",", "ugi", "get", "short", "user", "name", "(", ")", ",", "ugi", "get", "primary", "group", "name", "(", ")", ",", "link", "get", "target", "link", "(", ")", ",", "path", ")", ")", ";", "continue", ";", "}", "/", "/", "we", "will", "represent", "as", "non", "-", "symlinks", "here", "it", "will", "show", "target", "/", "/", "directory", "/", "file", "properties", "like", "permissions", ",", "is", "directory", "etc", "on", "/", "/", "mount", "path", "the", "path", "will", "be", "a", "mount", "link", "path", "and", "is", "directory", "is", "/", "/", "true", "if", "target", "is", "dir", ",", "otherwise", "false", "string", "linked", "path", "=", "link", "get", "target", "file", "system", "(", ")", "get", "uri", "(", ")", "get", "path", "(", ")", ";", "if", "(", "\"", "\"", "equals", "(", "linked", "path", ")", ")", "{", "linked", "path", "=", "\"", "/", "\"", ";", "}", "try", "{", "file", "status", "status", "=", "(", "(", "ch", "rooted", "fs", ")", "link", "get", "target", "file", "system", "(", ")", ")", "get", "my", "fs", "(", ")", "get", "file", "status", "(", "new", "path", "(", "linked", "path", ")", ")", ";", "link", "statuses", "add", "(", "new", "file", "status", "(", "status", "get", "len", "(", ")", ",", "status", "is", "directory", "(", ")", ",", "status", "get", "replication", "(", ")", ",", "status", "get", "block", "size", "(", ")", ",", "status", "get", "modification", "time", "(", ")", ",", "status", "get", "access", "time", "(", ")", ",", "status", "get", "permission", "(", ")", ",", "status", "get", "owner", "(", ")", ",", "status", "get", "group", "(", ")", ",", "null", ",", "path", ")", ")", ";", "}", "catch", "(", "file", "not", "found", "exception", "ex", ")", "{", "log", "warn", "(", "\"", "cannot", "get", "one", "of", "the", "children", "'", "s", "(", "\"", "+", "path", "+", "\"", ")", "target", "path", "(", "\"", "+", "link", "get", "target", "file", "system", "(", ")", "get", "uri", "(", ")", "+", "\"", ")", "file", "status", "\"", ",", "ex", ")", ";", "throw", "ex", ";", "}", "}", "else", "{", "internal", "dir", "statuses", "add", "(", "new", "file", "status", "(", "0", ",", "true", ",", "0", ",", "0", ",", "creation", "time", ",", "creation", "time", ",", "permission", "555", ",", "ugi", "get", "short", "user", "name", "(", ")", ",", "ugi", "get", "primary", "group", "name", "(", ")", ",", "path", ")", ")", ";", "}", "}", "file", "status", "[", "]", "internal", "dir", "statuses", "merged", "with", "fall", "back", "=", "internal", "dir", "statuses", "to", "array", "(", "new", "file", "status", "[", "internal", "dir", "statuses", "size", "(", ")", "]", ")", ";", "if", "(", "fallback", "statuses", "length", ">", "0", ")", "{", "internal", "dir", "statuses", "merged", "with", "fall", "back", "=", "merge", "(", "fallback", "statuses", ",", "internal", "dir", "statuses", "merged", "with", "fall", "back", ")", ";", "}", "/", "/", "links", "will", "always", "have", "precedence", "than", "internal", "dir", "or", "fallback", "paths", "return", "merge", "(", "link", "statuses", "to", "array", "(", "new", "file", "status", "[", "link", "statuses", "size", "(", ")", "]", ")", ",", "internal", "dir", "statuses", "merged", "with", "fall", "back", ")", ";", "}" ]
[ "return", "the", "contained", "producible", "media", "types", "excluding", "negated", "expressions" ]
[ "public", "set", "<", "media", "type", ">", "get", "producible", "media", "types", "(", ")", "{", "set", "<", "media", "type", ">", "result", "=", "new", "linked", "hash", "set", "<", ">", "(", ")", ";", "for", "(", "produce", "media", "type", "expression", "expression", ":", "this", "expressions", ")", "{", "if", "(", "!", "expression", "is", "negated", "(", ")", ")", "{", "result", "add", "(", "expression", "get", "media", "type", "(", ")", ")", ";", "}", "}", "return", "result", ";", "}" ]
[ "only", "add", "this", "key", "value", "pair", "if", "we", "haven", "'", "t", "seen", "this", "key", "before", "otherwise", ",", "ignore", "it" ]
[ "public", "void", "add", "(", "block", "key", ",", "block", "value", ",", "int", "key", "position", ",", "int", "value", "position", ")", "{", "if", "(", "!", "key", "exists", "(", "key", ",", "key", "position", ")", ")", "{", "add", "key", "(", "key", ",", "key", "position", ")", ";", "if", "(", "value", "is", "null", "(", "value", "position", ")", ")", "{", "value", "block", "builder", "append", "null", "(", ")", ";", "}", "else", "{", "value", "type", "append", "to", "(", "value", ",", "value", "position", ",", "value", "block", "builder", ")", ";", "}", "}", "}" ]
[ "executes", "the", "given", "command", "after", "the", "given", "delay" ]
[ "scheduled", "future", "<", "?", ">", "schedule", "(", "runnable", "command", ",", "long", "delay", ",", "time", "unit", "unit", ")", ";" ]
[ "clear", "the", "entire", "transaction", "synchronization", "state", ":", "registered", "synchronizations", "as", "well", "as", "the", "various", "transaction", "characteristics" ]
[ "public", "void", "clear", "(", ")", "{", "this", "transaction", "context", "clear", "(", ")", ";", "}" ]
[ "sets", "properties", "(", "codebase", "u", "r", "ls", ")", "for", "policy", "files", "we", "look", "for", "matching", "plugins", "and", "set", "u", "r", "ls", "to", "fit" ]
[ "static", "map", "<", "string", ",", "policy", ">", "get", "plugin", "and", "module", "permissions", "(", "environment", "environment", ")", "throws", "i", "o", "exception", "{", "map", "<", "string", ",", "policy", ">", "map", "=", "new", "hash", "map", "<", ">", "(", ")", ";", "consumer", "<", "plugin", "policy", "info", ">", "add", "policy", "=", "plugin", "policy", "-", ">", "{", "if", "(", "plugin", "policy", "=", "=", "null", ")", "{", "return", ";", "}", "/", "/", "consult", "this", "policy", "for", "each", "of", "the", "plugin", "'", "s", "jars", ":", "for", "(", "url", "jar", ":", "plugin", "policy", "jars", ")", "{", "if", "(", "map", "put", "(", "jar", "get", "file", "(", ")", ",", "plugin", "policy", "policy", ")", "!", "=", "null", ")", "{", "/", "/", "just", "be", "paranoid", "ok", "?", "throw", "new", "illegal", "state", "exception", "(", "\"", "per", "-", "plugin", "permissions", "already", "granted", "for", "jar", "file", ":", "\"", "+", "jar", ")", ";", "}", "}", "}", ";", "for", "(", "path", "plugin", ":", "plugins", "service", "find", "plugin", "dirs", "(", "environment", "plugins", "file", "(", ")", ")", ")", "{", "add", "policy", "accept", "(", "policy", "util", "get", "plugin", "policy", "info", "(", "plugin", ",", "environment", "tmp", "file", "(", ")", ")", ")", ";", "}", "for", "(", "path", "plugin", ":", "plugins", "service", "find", "plugin", "dirs", "(", "environment", "modules", "file", "(", ")", ")", ")", "{", "add", "policy", "accept", "(", "policy", "util", "get", "module", "policy", "info", "(", "plugin", ",", "environment", "tmp", "file", "(", ")", ")", ")", ";", "}", "return", "collections", "unmodifiable", "map", "(", "map", ")", ";", "}" ]
[ "this", "test", "really", "pushes", "the", "boundaries", "of", "what", "we", "support", "in", "general", "the", "splitter", "'", "s", "behaviour", "is", "not", "well", "defined", "if", "the", "char", "sequence", "it", "'", "s", "splitting", "is", "mutated", "during", "iteration" ]
[ "private", "void", "assert", "splitter", "iterable", "is", "lazy", "(", "splitter", "splitter", ")", "{", "string", "builder", "builder", "=", "new", "string", "builder", "(", ")", ";", "iterator", "<", "string", ">", "iterator", "=", "splitter", "split", "(", "builder", ")", "iterator", "(", ")", ";", "builder", "append", "(", "\"", "a", ",", "\"", ")", ";", "assert", "equals", "(", "\"", "a", "\"", ",", "iterator", "next", "(", ")", ")", ";", "builder", "append", "(", "\"", "b", ",", "\"", ")", ";", "assert", "equals", "(", "\"", "b", "\"", ",", "iterator", "next", "(", ")", ")", ";", "builder", "append", "(", "\"", "c", "\"", ")", ";", "assert", "equals", "(", "\"", "c", "\"", ",", "iterator", "next", "(", ")", ")", ";", "assert", "false", "(", "iterator", "has", "next", "(", ")", ")", ";", "}" ]
[ "a", "sensible", "definition", "of", "{", "@", "link", "#", "first", "key", "}", "in", "terms", "of", "{", "@", "code", "first", "entry", "}", "if", "you", "override", "{", "@", "code", "first", "entry", "}", ",", "you", "may", "wish", "to", "override", "{", "@", "code", "first", "key", "}", "to", "forward", "to", "this", "implementation" ]
[ "protected", "k", "standard", "first", "key", "(", ")", "{", "entry", "<", "k", ",", "v", ">", "entry", "=", "first", "entry", "(", ")", ";", "if", "(", "entry", "=", "=", "null", ")", "{", "throw", "new", "no", "such", "element", "exception", "(", ")", ";", "}", "else", "{", "return", "entry", "get", "key", "(", ")", ";", "}", "}" ]
[ "this", "implementation", "checks", "whether", "a", "file", "can", "be", "opened", ",", "falling", "back", "to", "whether", "an", "input", "stream", "can", "be", "opened", "this", "will", "cover", "both", "directories", "and", "content", "resources" ]
[ "public", "boolean", "exists", "(", ")", "{", "/", "/", "try", "file", "existence", ":", "can", "we", "find", "the", "file", "in", "the", "file", "system", "?", "try", "{", "return", "get", "file", "(", ")", "exists", "(", ")", ";", "}", "catch", "(", "i", "o", "exception", "ex", ")", "{", "/", "/", "fall", "back", "to", "stream", "existence", ":", "can", "we", "open", "the", "stream", "?", "try", "{", "input", "stream", "is", "=", "get", "input", "stream", "(", ")", ";", "is", "close", "(", ")", ";", "return", "true", ";", "}", "catch", "(", "throwable", "is", "ex", ")", "{", "return", "false", ";", "}", "}", "}" ]
[ "loops", "over", "all", "elements", "of", "the", "array", "until", "a", "null", "element", "is", "encountered", "or", "the", "given", "predicate", "returns", "true" ]
[ "public", "void", "for", "each", "while", "(", "non", "throwing", "predicate", "<", "?", "super", "t", ">", "consumer", ")", "{", "object", "[", "]", "a", "=", "head", ";", "final", "int", "c", "=", "capacity", ";", "while", "(", "a", "!", "=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "c", ";", "i", "+", "+", ")", "{", "object", "o", "=", "a", "[", "i", "]", ";", "if", "(", "o", "=", "=", "null", ")", "{", "break", ";", "}", "if", "(", "consumer", "test", "(", "(", "t", ")", "o", ")", ")", "{", "return", ";", "}", "}", "a", "=", "(", "object", "[", "]", ")", "a", "[", "c", "]", ";", "}", "}" ]
[ "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", "\"", ")", ";", "}" ]
[ "writes", "a", "short", "value", "into", "a", "byte", "array" ]
[ "default", "void", "put", "short", "(", "byte", "[", "]", "b", ",", "short", "value", ")", "{", "put", "short", "(", "b", ",", "0", ",", "value", ")", ";", "}" ]
[ "adds", "the", "specified", "environment", "variables" ]
[ "public", "void", "set", "environment", "variables", "(", "map", "<", "string", ",", "string", ">", "environment", ")", "{", "for", "(", "map", "entry", "<", "string", ",", "string", ">", "entry", ":", "environment", "entry", "set", "(", ")", ")", "{", "set", "environment", "variable", "(", "entry", "get", "key", "(", ")", ",", "entry", "get", "value", "(", ")", ")", ";", "}", "}" ]
[ "returns", "the", "text", "of", "this", "element", "or", ",", "null", "if", "no", "text", "existed", "in", "the", "xml" ]
[ "public", "string", "get", "text", "(", ")", "{", "return", "text", "=", "=", "null", "?", "\"", "\"", ":", "text", "to", "string", "(", ")", ";", "}" ]
[ "update", "and", "play", "the", "right", "music", "track" ]
[ "public", "void", "update", "(", ")", "{", "boolean", "paused", "=", "state", "is", "game", "(", ")", "&", "&", "core", "scene", "has", "dialog", "(", ")", ";", "boolean", "playing", "=", "state", "is", "game", "(", ")", ";", "/", "/", "check", "if", "current", "track", "is", "finished", "if", "(", "current", "!", "=", "null", "&", "&", "!", "current", "is", "playing", "(", ")", ")", "{", "current", "=", "null", ";", "fade", "=", "0f", ";", "}", "/", "/", "fade", "the", "lowpass", "filter", "in", "/", "out", ",", "poll", "every", "30", "ticks", "just", "in", "case", "performance", "is", "an", "issue", "if", "(", "timer", "get", "(", "1", ",", "3", "0f", ")", ")", "{", "core", "audio", "sound", "bus", "fade", "filter", "param", "(", "0", ",", "filters", "param", "wet", ",", "paused", "?", "1f", ":", "0f", ",", "0", "4f", ")", ";", "}", "/", "/", "play", "/", "stop", "ordinary", "effects", "if", "(", "playing", "!", "=", "was", "playing", ")", "{", "was", "playing", "=", "playing", ";", "if", "(", "playing", ")", "{", "core", "audio", "sound", "bus", "play", "(", ")", ";", "setup", "filters", "(", ")", ";", "}", "else", "{", "core", "audio", "sound", "bus", "replay", "(", ")", ";", "}", "}", "if", "(", "state", "is", "menu", "(", ")", ")", "{", "silenced", "=", "false", ";", "if", "(", "ui", "planet", "is", "shown", "(", ")", ")", "{", "play", "(", "musics", "launch", ")", ";", "}", "else", "if", "(", "ui", "editor", "is", "shown", "(", ")", ")", "{", "play", "(", "musics", "editor", ")", ";", "}", "else", "{", "play", "(", "musics", "menu", ")", ";", "}", "}", "else", "if", "(", "state", "rules", "editor", ")", "{", "silenced", "=", "false", ";", "play", "(", "musics", "editor", ")", ";", "}", "else", "{", "/", "/", "this", "just", "fades", "out", "the", "last", "track", "to", "make", "way", "for", "ingame", "music", "silence", "(", ")", ";", "/", "/", "play", "music", "at", "intervals", "if", "(", "timer", "get", "(", "music", "interval", ")", ")", "{", "/", "/", "chance", "to", "play", "it", "per", "interval", "if", "(", "mathf", "chance", "(", "music", "chance", ")", ")", "{", "play", "random", "(", ")", ";", "}", "}", "}", "update", "loops", "(", ")", ";", "}" ]
[ "get", "data", "source", "proxy", "holder", "instance" ]
[ "public", "static", "data", "source", "proxy", "holder", "get", "(", ")", "{", "return", "holder", "instance", ";", "}" ]
[ "creates", "a", "simple", "key", "-", "value", "table", "of", "the", "form", "key", ":", "some", "value", "another", "key", ":", "some", "other", "value", "yet", "another", "key", ":", "and", "so", "on", "the", "return", "value", "will", "not", "include", "a", "final", "{", "@", "code", "\"", "\\", "n", "\"", "}" ]
[ "public", "static", "string", "layout", "table", "(", "map", "<", "string", ",", "string", ">", "data", ")", "{", "list", "<", "string", ">", "table", "lines", "=", "new", "array", "list", "<", ">", "(", ")", ";", "for", "(", "map", "entry", "<", "string", ",", "string", ">", "entry", ":", "data", "entry", "set", "(", ")", ")", "{", "table", "lines", "add", "(", "entry", "get", "key", "(", ")", "+", "\"", ":", "\"", "+", "entry", "get", "value", "(", ")", ")", ";", "}", "return", "newline", "joiner", "join", "(", "table", "lines", ")", ";", "}" ]
[ "extract", "the", "source", "metadata", "from", "the", "candidate", "object", "supplied", "by", "the", "configuration", "parser" ]
[ "object", "extract", "source", "(", "object", "source", "candidate", ",", "@", "nullable", "resource", "defining", "resource", ")", ";" ]
[ "calls", "shell", "to", "get", "users", "for", "a", "netgroup", "by", "calling", "getent", "netgroup", ",", "this", "is", "a", "low", "level", "function", "that", "just", "returns", "string", "that" ]
[ "protected", "string", "exec", "shell", "get", "user", "for", "netgroup", "(", "final", "string", "netgroup", ")", "throws", "i", "o", "exception", "{", "string", "result", "=", "\"", "\"", ";", "try", "{", "/", "/", "shell", "command", "does", "not", "expect", "'", "@", "'", "at", "the", "beginning", "of", "the", "group", "name", "result", "=", "shell", "exec", "command", "(", "shell", "get", "users", "for", "netgroup", "command", "(", "netgroup", "substring", "(", "1", ")", ")", ")", ";", "}", "catch", "(", "exit", "code", "exception", "e", ")", "{", "/", "/", "if", "we", "didn", "'", "t", "get", "the", "group", "-", "just", "return", "empty", "list", ";", "log", "warn", "(", "\"", "error", "getting", "users", "for", "netgroup", "\"", "+", "netgroup", ",", "e", ")", ";", "}", "return", "result", ";", "}" ]
[ "get", "lookup", "result", "and", "re", "-", "map", "output", "columns", "based", "on", "requested", "order" ]
[ "private", "static", "record", "set", "lookup", "index", "keys", "(", "record", "set", "keys", ",", "indexed", "table", "table", ",", "list", "<", "string", ">", "output", "column", "names", ")", "{", "record", "set", "all", "columns", "output", "record", "set", "=", "table", "lookup", "keys", "(", "keys", ")", ";", "list", "<", "integer", ">", "output", "remap", "=", "compute", "remap", "(", "table", "get", "output", "columns", "(", ")", ",", "output", "column", "names", ")", ";", "return", "new", "mapped", "record", "set", "(", "all", "columns", "output", "record", "set", ",", "output", "remap", ")", ";", "}" ]
[ "tests", "that", "terminating", "the", "dispatcher", "will", "wait", "for", "all", "job", "masters", "to", "be", "terminated" ]
[ "public", "void", "test", "dispatcher", "termination", "waits", "for", "job", "master", "terminations", "(", ")", "throws", "exception", "{", "final", "testing", "job", "manager", "runner", "factory", "job", "manager", "runner", "factory", "=", "start", "dispatcher", "and", "submit", "job", "(", "1", ")", ";", "final", "completable", "future", "<", "void", ">", "dispatcher", "termination", "future", "=", "dispatcher", "close", "async", "(", ")", ";", "try", "{", "dispatcher", "termination", "future", "get", "(", "10l", ",", "time", "unit", "milliseconds", ")", ";", "fail", "(", "\"", "we", "should", "not", "terminate", "before", "all", "running", "job", "masters", "have", "terminated", "\"", ")", ";", "}", "catch", "(", "timeout", "exception", "ignored", ")", "{", "/", "/", "expected", "}", "finally", "{", "job", "manager", "runner", "factory", "take", "created", "job", "manager", "runner", "(", ")", "complete", "termination", "future", "(", ")", ";", "}", "dispatcher", "termination", "future", "get", "(", ")", ";", "}" ]
[ "create", "a", "new", "{", "@", "link", "indexed", "inputs", "}", "with", "input", "files", "already", "indexed", "and", "with", "a", "parent", "{", "@", "link", "indexed", "inputs", "}" ]
[ "public", "indexed", "inputs", "with", "parent", "(", "indexed", "inputs", "parent", ")", "{", "check", "state", "(", "this", "parent", "=", "=", "null", ")", ";", "return", "new", "indexed", "inputs", "(", "this", "input", "files", ",", "parent", ")", ";", "}" ]
[ "sets", "the", "one", "and", "only", "color", "that", "should", "be", "used", "for", "this", "data", "set", "internally", ",", "this", "recreates", "the", "colors", "array", "and", "adds", "the", "specified", "color" ]
[ "public", "void", "set", "color", "(", "int", "color", ")", "{", "reset", "colors", "(", ")", ";", "m", "colors", "add", "(", "color", ")", ";", "}" ]
[ "alternative", "to", "{", "@", "link", "#", "return", "result", "(", "class", ")", "}", "that", "accepts", "information", "about", "a", "target", "type", "with", "generics" ]
[ "<", "t", ">", "flux", "exchange", "result", "<", "t", ">", "return", "result", "(", "parameterized", "type", "reference", "<", "t", ">", "element", "type", "ref", ")", ";" ]
[ "model", "tests", "for", "pet" ]
[ "public", "void", "test", "pet", "(", ")", "{", "/", "/", "todo", ":", "test", "pet", "}" ]
[ "return", "a", "model", "map", "for", "the", "obtained", "state", ",", "exposing", "an", "errors", "instance", "as", "'", "{", "@", "link", "#", "model", "key", "prefix", "model", "key", "prefix", "}", "+", "object", "name", "'", "and", "the", "object", "itself", "note", "that", "the", "map", "is", "constructed", "every", "time", "you", "'", "re", "calling", "this", "method", "adding", "things", "to", "the", "map", "and", "then", "re", "-", "calling", "this", "method", "will", "not", "work", "the", "attributes", "in", "the", "model", "map", "returned", "by", "this", "method", "are", "usually", "included", "in", "the", "model", "and", "view", "for", "a", "form", "view", "that", "uses", "spring", "'", "s", "bind", "tag", ",", "which", "needs", "access", "to", "the", "errors", "instance" ]
[ "public", "map", "<", "string", ",", "object", ">", "get", "model", "(", ")", "{", "map", "<", "string", ",", "object", ">", "model", "=", "new", "linked", "hash", "map", "<", ">", "(", "2", ")", ";", "/", "/", "mapping", "from", "name", "to", "target", "object", "model", "put", "(", "get", "object", "name", "(", ")", ",", "get", "target", "(", ")", ")", ";", "/", "/", "errors", "instance", ",", "even", "if", "no", "errors", "model", "put", "(", "model", "key", "prefix", "+", "get", "object", "name", "(", ")", ",", "this", ")", ";", "return", "model", ";", "}" ]
[ "trigger", "config", "dump", "event" ]
[ "public", "static", "boolean", "config", "dump", "(", "config", "dump", "event", "event", ")", "{", "final", "string", "data", "id", "=", "event", "get", "data", "id", "(", ")", ";", "final", "string", "group", "=", "event", "get", "group", "(", ")", ";", "final", "string", "namespace", "id", "=", "event", "get", "namespace", "id", "(", ")", ";", "final", "string", "content", "=", "event", "get", "content", "(", ")", ";", "final", "string", "type", "=", "event", "get", "type", "(", ")", ";", "final", "long", "last", "modified", "=", "event", "get", "last", "modified", "ts", "(", ")", ";", "if", "(", "event", "is", "beta", "(", ")", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "event", "is", "remove", "(", ")", ")", "{", "result", "=", "config", "cache", "service", "remove", "beta", "(", "data", "id", ",", "group", ",", "namespace", "id", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "remove", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "0", ")", ";", "}", "return", "result", ";", "}", "else", "{", "result", "=", "config", "cache", "service", "dump", "beta", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "content", ",", "last", "modified", ",", "event", "get", "beta", "ips", "(", ")", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "content", "length", "(", ")", ")", ";", "}", "}", "return", "result", ";", "}", "if", "(", "string", "utils", "is", "blank", "(", "event", "get", "tag", "(", ")", ")", ")", "{", "if", "(", "data", "id", "equals", "(", "aggr", "whitelist", "aggrids", "metadata", ")", ")", "{", "aggr", "whitelist", "load", "(", "content", ")", ";", "}", "if", "(", "data", "id", "equals", "(", "client", "ip", "white", "list", "client", "ip", "whitelist", "metadata", ")", ")", "{", "client", "ip", "white", "list", "load", "(", "content", ")", ";", "}", "if", "(", "data", "id", "equals", "(", "switch", "service", "switch", "meta", "dataid", ")", ")", "{", "switch", "service", "load", "(", "content", ")", ";", "}", "boolean", "result", ";", "if", "(", "!", "event", "is", "remove", "(", ")", ")", "{", "result", "=", "config", "cache", "service", "dump", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "content", ",", "last", "modified", ",", "type", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "content", "length", "(", ")", ")", ";", "}", "}", "else", "{", "result", "=", "config", "cache", "service", "remove", "(", "data", "id", ",", "group", ",", "namespace", "id", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "remove", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "0", ")", ";", "}", "}", "return", "result", ";", "}", "else", "{", "/", "/", "boolean", "result", ";", "if", "(", "!", "event", "is", "remove", "(", ")", ")", "{", "result", "=", "config", "cache", "service", "dump", "tag", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "event", "get", "tag", "(", ")", ",", "content", ",", "last", "modified", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "content", "length", "(", ")", ")", ";", "}", "}", "else", "{", "result", "=", "config", "cache", "service", "remove", "tag", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "event", "get", "tag", "(", ")", ")", ";", "if", "(", "result", ")", "{", "config", "trace", "service", "log", "dump", "event", "(", "data", "id", ",", "group", ",", "namespace", "id", ",", "null", ",", "last", "modified", ",", "event", "get", "handle", "ip", "(", ")", ",", "config", "trace", "service", "dump", "event", "remove", "ok", ",", "system", "current", "time", "millis", "(", ")", "-", "last", "modified", ",", "0", ")", ";", "}", "}", "return", "result", ";", "}", "}" ]
[ "returns", "the", "{", "@", "code", "byte", "}", "value", "that", ",", "when", "treated", "as", "unsigned", ",", "is", "nearest", "in", "value", "to", "{", "@", "code", "value", "}" ]
[ "public", "static", "byte", "saturated", "cast", "(", "long", "value", ")", "{", "if", "(", "value", ">", "to", "int", "(", "max", "value", ")", ")", "{", "return", "max", "value", ";", "/", "/", "-", "1", "}", "if", "(", "value", "<", "0", ")", "{", "return", "(", "byte", ")", "0", ";", "}", "return", "(", "byte", ")", "value", ";", "}" ]
[ "executes", "the", "given", "task", "in", "a", "custom", "thread", "pool", "at", "fix", "rate" ]
[ "public", "static", "<", "t", ">", "void", "execute", "by", "custom", "at", "fix", "rate", "(", "final", "executor", "service", "pool", ",", "final", "task", "<", "t", ">", "task", ",", "final", "long", "period", ",", "final", "time", "unit", "unit", ")", "{", "execute", "at", "fixed", "rate", "(", "pool", ",", "task", ",", "0", ",", "period", ",", "unit", ")", ";", "}" ]
[ "gets", "the", "user", "code", "wrapper", "in", "the", "case", "of", "a", "pact", ",", "that", "object", "will", "be", "the", "stub", "with", "the", "user", "function", ",", "in", "the", "case", "of", "an", "input", "or", "output", "format", ",", "it", "will", "be", "the", "format", "object" ]
[ "public", "user", "code", "wrapper", "<", "?", ">", "get", "user", "code", "wrapper", "(", ")", "{", "return", "null", ";", "}" ]
[ "return", "the", "class", "loader", "that", "this", "accessor", "operates", "in", ",", "to", "be", "used", "for", "deserializing", "and", "for", "generating", "proxies" ]
[ "protected", "class", "loader", "get", "bean", "class", "loader", "(", ")", "{", "return", "this", "bean", "class", "loader", ";", "}" ]
[ "test", "sps", "for", "low", "redundant", "file", "blocks", "1", "create", "cluster", "with", "3", "datanode", "1", "create", "one", "file", "with", "3", "replica", "2", "set", "policy", "and", "call", "satisfy", "storage", "policy", "for", "file", "3", "stop", "name", "node", "and", "datanodes", "4", "start", "name", "node", "with", "2", "datanode", "and", "wait", "for", "block", "movement", "5", "start", "third", "datanode", "6", "third", "datanode", "replica", "also", "should", "be", "moved", "in", "proper", "sorage", "based", "on", "policy" ]
[ "public", "void", "test", "s", "p", "s", "when", "file", "has", "low", "redundancy", "blocks", "(", ")", "throws", "exception", "{", "try", "{", "config", "set", "(", "d", "f", "s", "config", "keys", "dfs", "storage", "policy", "satisfier", "recheck", "timeout", "millis", "key", ",", "\"", "3000", "\"", ")", ";", "config", "set", "(", "d", "f", "s", "config", "keys", "dfs", "storage", "policy", "satisfier", "self", "retry", "timeout", "millis", "key", ",", "\"", "5000", "\"", ")", ";", "storage", "type", "[", "]", "[", "]", "newtypes", "=", "new", "storage", "type", "[", "]", "[", "]", "{", "{", "storage", "type", "archive", ",", "storage", "type", "disk", "}", ",", "{", "storage", "type", "archive", ",", "storage", "type", "disk", "}", ",", "{", "storage", "type", "archive", ",", "storage", "type", "disk", "}", "}", ";", "hdfs", "cluster", "=", "start", "cluster", "(", "config", ",", "newtypes", ",", "3", ",", "2", ",", "capacity", ")", ";", "hdfs", "cluster", "wait", "active", "(", ")", ";", "distributed", "file", "system", "fs", "=", "hdfs", "cluster", "get", "file", "system", "(", ")", ";", "path", "file", "path", "=", "new", "path", "(", "\"", "/", "zero", "size", "file", "\"", ")", ";", "d", "f", "s", "test", "util", "create", "file", "(", "fs", ",", "file", "path", ",", "1024", ",", "(", "short", ")", "3", ",", "0", ")", ";", "fs", "set", "storage", "policy", "(", "file", "path", ",", "\"", "cold", "\"", ")", ";", "list", "<", "data", "node", "properties", ">", "list", "=", "new", "array", "list", "<", ">", "(", ")", ";", "list", "add", "(", "hdfs", "cluster", "stop", "data", "node", "(", "0", ")", ")", ";", "list", "add", "(", "hdfs", "cluster", "stop", "data", "node", "(", "0", ")", ")", ";", "list", "add", "(", "hdfs", "cluster", "stop", "data", "node", "(", "0", ")", ")", ";", "restart", "namenode", "(", ")", ";", "hdfs", "cluster", "restart", "data", "node", "(", "list", "get", "(", "0", ")", ",", "false", ")", ";", "hdfs", "cluster", "restart", "data", "node", "(", "list", "get", "(", "1", ")", ",", "false", ")", ";", "hdfs", "cluster", "wait", "active", "(", ")", ";", "fs", "satisfy", "storage", "policy", "(", "file", "path", ")", ";", "d", "f", "s", "test", "util", "wait", "expected", "storage", "type", "(", "file", "path", "to", "string", "(", ")", ",", "storage", "type", "archive", ",", "2", ",", "30000", ",", "hdfs", "cluster", "get", "file", "system", "(", ")", ")", ";", "hdfs", "cluster", "restart", "data", "node", "(", "list", "get", "(", "2", ")", ",", "false", ")", ";", "d", "f", "s", "test", "util", "wait", "expected", "storage", "type", "(", "file", "path", "to", "string", "(", ")", ",", "storage", "type", "archive", ",", "3", ",", "30000", ",", "hdfs", "cluster", "get", "file", "system", "(", ")", ")", ";", "}", "finally", "{", "shutdown", "cluster", "(", ")", ";", "}", "}" ]
[ "test", "if", "task", "timeout", "is", "set", "properly", "in", "response", "to", "the", "configuration", "of", "the", "task", "progress", "report", "interval" ]
[ "private", "static", "void", "test", "task", "timeout", "wrt", "progress", "report", "interval", "(", "long", "timeout", "config", ",", "long", "taskreport", "interval", ")", "{", "final", "configuration", "conf", "=", "new", "configuration", "(", ")", ";", "conf", "set", "long", "(", "m", "r", "job", "config", "task", "timeout", ",", "timeout", "config", ")", ";", "conf", "set", "long", "(", "m", "r", "job", "config", "task", "progress", "report", "interval", ",", "taskreport", "interval", ")", ";", "/", "/", "expected", "task", "timeout", "is", "at", "least", "twice", "as", "long", "as", "task", "report", "interval", "final", "long", "expected", "timeout", "=", "math", "max", "(", "timeout", "config", ",", "taskreport", "interval", "*", "2", ")", ";", "verify", "task", "timeout", "config", "(", "conf", ",", "expected", "timeout", ")", ";", "}" ]
[ "adds", "the", "{", "@", "code", "runnable", "}", "and", "accompanying", "{", "@", "code", "executor", "}", "to", "the", "list", "of", "listeners", "to", "execute", "if", "execution", "has", "already", "begun", ",", "the", "listener", "is", "executed", "immediately", "when", "selecting", "an", "executor", ",", "note", "that", "{", "@", "code", "direct", "executor", "}", "is", "dangerous", "in", "some", "cases", "see", "the", "discussion", "in", "the", "{", "@", "link", "listenable", "future", "#", "add", "listener", "listenable", "future", "add", "listener", "}", "documentation" ]
[ "public", "void", "add", "(", "runnable", "runnable", ",", "executor", "executor", ")", "{", "/", "/", "fail", "fast", "on", "a", "null", "we", "throw", "npe", "here", "because", "the", "contract", "of", "executor", "states", "that", "it", "throws", "/", "/", "npe", "on", "null", "listener", ",", "so", "we", "propagate", "that", "contract", "up", "into", "the", "add", "method", "as", "well", "check", "not", "null", "(", "runnable", ",", "\"", "runnable", "was", "null", "\"", ")", ";", "check", "not", "null", "(", "executor", ",", "\"", "executor", "was", "null", "\"", ")", ";", "/", "/", "lock", "while", "we", "check", "state", "we", "must", "maintain", "the", "lock", "while", "adding", "the", "new", "pair", "so", "that", "/", "/", "another", "thread", "can", "'", "t", "run", "the", "list", "out", "from", "under", "us", "we", "only", "add", "to", "the", "list", "if", "we", "have", "not", "/", "/", "yet", "started", "execution", "synchronized", "(", "this", ")", "{", "if", "(", "!", "executed", ")", "{", "runnables", "=", "new", "runnable", "executor", "pair", "(", "runnable", ",", "executor", ",", "runnables", ")", ";", "return", ";", "}", "}", "/", "/", "execute", "the", "runnable", "immediately", "because", "of", "scheduling", "this", "may", "end", "up", "getting", "called", "before", "/", "/", "some", "of", "the", "previously", "added", "runnables", ",", "but", "we", "'", "re", "ok", "with", "that", "if", "we", "want", "to", "change", "the", "/", "/", "contract", "to", "guarantee", "ordering", "among", "runnables", "we", "'", "d", "have", "to", "modify", "the", "logic", "here", "to", "allow", "/", "/", "it", "execute", "listener", "(", "runnable", ",", "executor", ")", ";", "}" ]
[ "resizes", "the", "internal", "entries", "array", "to", "the", "specified", "capacity", ",", "which", "may", "be", "greater", "or", "less", "than", "the", "current", "capacity" ]
[ "void", "resize", "entries", "(", "int", "new", "capacity", ")", "{", "this", "entries", "=", "arrays", "copy", "of", "(", "entries", ",", "new", "capacity", ")", ";", "this", "elements", "=", "arrays", "copy", "of", "(", "elements", ",", "new", "capacity", ")", ";", "}" ]
[ "init", "the", "{", "@", "link", "s", "s", "l", "engine", "}" ]
[ "protected", "abstract", "void", "init", "engine", "(", "s", "s", "l", "engine", "engine", ")", ";" ]
[ "check", "if", "two", "nodes", "are", "on", "the", "same", "node", "group", "(", "hypervisor", ")", "the", "assumption", "here", "is", ":", "each", "nodes", "are", "leaf", "nodes" ]
[ "public", "boolean", "is", "on", "same", "node", "group", "(", "node", "node", "1", ",", "node", "node", "2", ")", "{", "if", "(", "node", "1", "=", "=", "null", "|", "|", "node", "2", "=", "=", "null", ")", "{", "return", "false", ";", "}", "netlock", "read", "lock", "(", ")", "lock", "(", ")", ";", "try", "{", "return", "is", "same", "parents", "(", "node", "1", ",", "node", "2", ")", ";", "}", "finally", "{", "netlock", "read", "lock", "(", ")", "unlock", "(", ")", ";", "}", "}" ]
[ "returns", "original", "flow", "destination", "address", "for", "instruction", "or", "null" ]
[ "public", "address", "get", "flow", "dest", "addr", "(", ")", "{", "throw", "new", "sleigh", "exception", "(", "\"", "flow", "destination", "(", "inst", "dest", ")", "is", "undefined", "at", "\"", "+", "get", "addr", "(", ")", ")", ";", "}" ]
[ "test", "{", "@", "link", "block", "pool", "token", "secret", "manager", "}" ]
[ "private", "void", "test", "block", "pool", "token", "secret", "manager", "(", "boolean", "enable", "protobuf", ")", "throws", "exception", "{", "block", "pool", "token", "secret", "manager", "bp", "mgr", "=", "new", "block", "pool", "token", "secret", "manager", "(", ")", ";", "/", "/", "test", "block", "pool", "secret", "manager", "with", "upto", "10", "block", "pools", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "+", "+", ")", "{", "string", "bpid", "=", "integer", "to", "string", "(", "i", ")", ";", "block", "token", "secret", "manager", "master", "handler", "=", "new", "block", "token", "secret", "manager", "(", "block", "key", "update", "interval", ",", "block", "token", "lifetime", ",", "0", ",", "1", ",", "\"", "fake", "-", "pool", "\"", ",", "null", ",", "enable", "protobuf", ")", ";", "block", "token", "secret", "manager", "slave", "handler", "=", "new", "block", "token", "secret", "manager", "(", "block", "key", "update", "interval", ",", "block", "token", "lifetime", ",", "\"", "fake", "-", "pool", "\"", ",", "null", ",", "enable", "protobuf", ")", ";", "bp", "mgr", "add", "block", "pool", "(", "bpid", ",", "slave", "handler", ")", ";", "exported", "block", "keys", "keys", "=", "master", "handler", "export", "keys", "(", ")", ";", "bp", "mgr", "add", "keys", "(", "bpid", ",", "keys", ")", ";", "string", "[", "]", "storage", "ids", "=", "new", "string", "[", "]", "{", "\"", "ds", "-", "9001", "\"", "}", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "new", "storage", "type", "[", "]", "{", "storage", "type", "default", "}", ",", "storage", "ids", ")", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "null", ",", "null", ")", ";", "/", "/", "test", "key", "updating", "master", "handler", "update", "keys", "(", ")", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "new", "storage", "type", "[", "]", "{", "storage", "type", "default", "}", ",", "storage", "ids", ")", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "null", ",", "null", ")", ";", "keys", "=", "master", "handler", "export", "keys", "(", ")", ";", "bp", "mgr", "add", "keys", "(", "bpid", ",", "keys", ")", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "new", "storage", "type", "[", "]", "{", "storage", "type", "default", "}", ",", "new", "string", "[", "]", "{", "\"", "ds", "-", "9001", "\"", "}", ")", ";", "token", "generation", "and", "verification", "(", "master", "handler", ",", "bp", "mgr", "get", "(", "bpid", ")", ",", "null", ",", "null", ")", ";", "}", "}" ]
[ "get", "result", "type", "by", "arguments", "and", "arg", "types", "we", "can", "'", "t", "use", "get", "result", "type", "(", "object", "[", "]", ",", "class", "[", "]", ")", "the", "class", "[", "]", "is", "the", "classes", "of", "what", "is", "defined", "in", "eval", "(", ")", ",", "for", "example", ",", "if", "eval", "(", ")", "is", "\"", "public", "integer", "eval", "(", "double", ")", "\"", ",", "the", "arg", "types", "would", "be", "class", "[", "double", "]", "however", ",", "in", "our", "wrapper", ",", "the", "signature", "of", "eval", "(", ")", "is", "\"", "public", "object", "eval", "(", "object", "args", ")", "\"", ",", "which", "means", "we", "cannot", "get", "any", "info", "from", "the", "interface" ]
[ "data", "type", "get", "hive", "result", "type", "(", "object", "[", "]", "constant", "arguments", ",", "data", "type", "[", "]", "arg", "types", ")", ";" ]
[ "you", "can", "use", "this", "api", "to", "get", "load", "libs", "before", "tinker", "is", "installed", "same", "as", "{", "@", "code", "tinker", "get", "tinker", "load", "result", "if", "present", "libs", "}" ]
[ "public", "static", "hash", "map", "<", "string", ",", "string", ">", "get", "load", "library", "and", "md", "5", "(", "application", "like", "application", "like", ")", "{", "if", "(", "application", "like", "=", "=", "null", "|", "|", "application", "like", "get", "application", "(", ")", "=", "=", "null", ")", "{", "throw", "new", "tinker", "runtime", "exception", "(", "\"", "tinker", "application", "is", "null", "\"", ")", ";", "}", "intent", "tinker", "result", "intent", "=", "application", "like", "get", "tinker", "result", "intent", "(", ")", ";", "if", "(", "tinker", "result", "intent", "=", "=", "null", ")", "{", "return", "null", ";", "}", "int", "load", "code", "=", "share", "intent", "util", "get", "intent", "return", "code", "(", "tinker", "result", "intent", ")", ";", "if", "(", "load", "code", "=", "=", "share", "constants", "error", "load", "ok", ")", "{", "return", "share", "intent", "util", "get", "intent", "patch", "libs", "paths", "(", "tinker", "result", "intent", ")", ";", "}", "return", "null", ";", "}" ]
[ "returns", "a", "new", "address", "in", "this", "space", "with", "the", "given", "byte", "offset", "note", ":", "this", "method", "is", "the", "same", "as", "invoking", "get", "address", "(", "long", "byte", "offset", ",", "false", ")" ]
[ "address", "get", "address", "(", "long", "byte", "offset", ")", "throws", "address", "out", "of", "bounds", "exception", ";" ]
[ "override", "this", "method", "to", "provide", "a", "custom", "{", "@", "link", "validator", "}" ]
[ "protected", "validator", "get", "validator", "(", ")", "{", "return", "null", ";", "}" ]
[ "paint", "the", "element" ]
[ "private", "void", "paint", "(", "paint", "event", "e", ")", "{", "e", "gc", "set", "foreground", "(", "widget", "foreground", ")", ";", "rectangle", "bounds", "=", "get", "bounds", "(", ")", ";", "if", "(", "elements", "length", "!", "=", "0", ")", "{", "e", "gc", "fill", "rectangle", "(", "0", ",", "0", ",", "bounds", "width", ",", "bounds", "height", ")", ";", "e", "gc", "set", "foreground", "(", "widget", "normal", "shadow", ")", ";", "if", "(", "!", "section", "|", "|", "is", "down", "scroll", "required", "(", ")", ")", "{", "e", "gc", "draw", "line", "(", "bounds", "width", "-", "1", ",", "0", ",", "bounds", "width", "-", "1", ",", "bounds", "height", "-", "1", ")", ";", "}", "else", "{", "e", "gc", "draw", "line", "(", "bounds", "width", "-", "1", ",", "0", ",", "bounds", "width", "-", "1", ",", "bounds", "height", "-", "section", "div", "height", ")", ";", "e", "gc", "draw", "point", "(", "bounds", "width", "-", "1", ",", "bounds", "height", "-", "1", ")", ";", "}", "e", "gc", "draw", "line", "(", "0", ",", "0", ",", "bounds", "width", "-", "1", ",", "0", ")", ";", "e", "gc", "set", "foreground", "(", "bottom", "navigation", "element", "shadow", "stroke", "1", ")", ";", "e", "gc", "draw", "line", "(", "0", ",", "1", ",", "bounds", "width", "-", "2", ",", "1", ")", ";", "e", "gc", "set", "foreground", "(", "bottom", "navigation", "element", "shadow", "stroke", "2", ")", ";", "e", "gc", "draw", "line", "(", "0", ",", "2", ",", "bounds", "width", "-", "2", ",", "2", ")", ";", "}", "else", "{", "e", "gc", "set", "background", "(", "list", "background", ")", ";", "e", "gc", "fill", "rectangle", "(", "0", ",", "0", ",", "bounds", "width", ",", "bounds", "height", ")", ";", "}", "if", "(", "is", "down", "scroll", "required", "(", ")", ")", "{", "e", "gc", "set", "foreground", "(", "widget", "dark", "shadow", ")", ";", "int", "middle", "=", "bounds", "width", "/", "2", ";", "int", "bottom", "=", "bounds", "height", "-", "3", ";", "e", "gc", "draw", "line", "(", "middle", "+", "1", ",", "bottom", ",", "middle", "+", "5", ",", "bottom", "-", "4", ")", ";", "e", "gc", "draw", "line", "(", "middle", ",", "bottom", ",", "middle", "-", "4", ",", "bottom", "-", "4", ")", ";", "e", "gc", "draw", "line", "(", "middle", "-", "3", ",", "bottom", "-", "4", ",", "middle", "+", "4", ",", "bottom", "-", "4", ")", ";", "e", "gc", "set", "foreground", "(", "list", "background", ")", ";", "e", "gc", "draw", "line", "(", "middle", ",", "bottom", "-", "1", ",", "middle", "+", "1", ",", "bottom", "-", "1", ")", ";", "e", "gc", "draw", "line", "(", "middle", "-", "1", ",", "bottom", "-", "2", ",", "middle", "+", "2", ",", "bottom", "-", "2", ")", ";", "e", "gc", "draw", "line", "(", "middle", "-", "2", ",", "bottom", "-", "3", ",", "middle", "+", "3", ",", "bottom", "-", "3", ")", ";", "e", "gc", "set", "foreground", "(", "widget", "normal", "shadow", ")", ";", "e", "gc", "draw", "line", "(", "0", ",", "bottom", "-", "7", ",", "bounds", "width", "-", "2", ",", "bottom", "-", "7", ")", ";", "e", "gc", "set", "foreground", "(", "navigation", "element", "shadow", "stroke", ")", ";", "e", "gc", "draw", "line", "(", "0", ",", "bottom", "+", "2", ",", "bounds", "width", "-", "2", ",", "bottom", "+", "2", ")", ";", "e", "gc", "draw", "line", "(", "0", ",", "bottom", "-", "6", ",", "bounds", "width", "-", "2", ",", "bottom", "-", "6", ")", ";", "}", "}" ]
[ "checks", "that", "value", "is", "present", "as", "at", "least", "one", "of", "the", "elements", "of", "the", "array" ]
[ "public", "static", "<", "t", ">", "boolean", "contains", "(", "t", "[", "]", "array", ",", "t", "value", ")", "{", "for", "(", "t", "element", ":", "array", ")", "{", "if", "(", "element", "=", "=", "null", ")", "{", "if", "(", "value", "=", "=", "null", ")", "return", "true", ";", "}", "else", "{", "if", "(", "value", "!", "=", "null", "&", "&", "element", "equals", "(", "value", ")", ")", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
[ "creates", "the", "{", "@", "link", "plugin", "manager", "}", "to", "use", "if", "no", "one", "is", "provided", "to", "a", "{", "@", "link", "jenkins", "}", "object", "this", "method", "will", "be", "called", "after", "creation", "of", "{", "@", "link", "jenkins", "}", "object", ",", "but", "before", "it", "is", "fully", "initialized" ]
[ "public", "static", "@", "non", "null", "plugin", "manager", "create", "default", "(", "@", "non", "null", "jenkins", "jenkins", ")", "{", "string", "pm", "class", "name", "=", "system", "properties", "get", "string", "(", "custom", "plugin", "manager", ")", ";", "if", "(", "!", "string", "utils", "is", "blank", "(", "pm", "class", "name", ")", ")", "{", "logger", "log", "(", "fine", ",", "string", "format", "(", "\"", "use", "of", "custom", "plugin", "manager", "[", "%", "s", "]", "requested", "\"", ",", "pm", "class", "name", ")", ")", ";", "try", "{", "final", "class", "<", "?", "extends", "plugin", "manager", ">", "klass", "=", "class", "for", "name", "(", "pm", "class", "name", ")", "as", "subclass", "(", "plugin", "manager", "class", ")", ";", "/", "/", "iteration", "is", "in", "declaration", "order", "for", "(", "p", "m", "constructor", "c", ":", "p", "m", "constructor", "values", "(", ")", ")", "{", "plugin", "manager", "pm", "=", "c", "create", "(", "klass", ",", "jenkins", ")", ";", "if", "(", "pm", "!", "=", "null", ")", "{", "return", "pm", ";", "}", "}", "logger", "log", "(", "warning", ",", "string", "format", "(", "\"", "provided", "custom", "plugin", "manager", "[", "%", "s", "]", "does", "not", "provide", "any", "of", "the", "suitable", "constructors", "using", "default", "\"", ",", "pm", "class", "name", ")", ")", ";", "}", "catch", "(", "null", "pointer", "exception", "e", ")", "{", "/", "/", "class", "for", "name", "and", "class", "get", "constructor", "are", "supposed", "to", "never", "return", "null", "though", "a", "broken", "class", "loader", "/", "/", "could", "break", "the", "contract", "just", "in", "case", "we", "introduce", "this", "specific", "catch", "to", "avoid", "polluting", "the", "logs", "with", "n", "p", "es", "logger", "log", "(", "warning", ",", "string", "format", "(", "\"", "unable", "to", "instantiate", "custom", "plugin", "manager", "[", "%", "s", "]", "using", "default", "\"", ",", "pm", "class", "name", ")", ")", ";", "}", "catch", "(", "class", "cast", "exception", "e", ")", "{", "logger", "log", "(", "warning", ",", "string", "format", "(", "\"", "provided", "class", "[", "%", "s", "]", "does", "not", "extend", "plugin", "manager", "using", "default", "\"", ",", "pm", "class", "name", ")", ")", ";", "}", "catch", "(", "exception", "e", ")", "{", "logger", "log", "(", "warning", ",", "string", "format", "(", "\"", "unable", "to", "instantiate", "custom", "plugin", "manager", "[", "%", "s", "]", "using", "default", "\"", ",", "pm", "class", "name", ")", ",", "e", ")", ";", "}", "}", "return", "new", "local", "plugin", "manager", "(", "jenkins", ")", ";", "}" ]
[ "gets", "the", "number", "of", "the", "slot", "into", "which", "the", "task", "is", "to", "be", "deployed" ]
[ "public", "int", "get", "target", "slot", "number", "(", ")", "{", "return", "target", "slot", "number", ";", "}" ]
[ "closes", "the", "local", "side", "of", "the", "given", "stream", "if", "this", "causes", "the", "stream", "to", "be", "closed", ",", "adds", "a", "hook", "to", "close", "the", "channel", "after", "the", "given", "future", "completes" ]
[ "public", "void", "close", "stream", "local", "(", "http", "2", "stream", "stream", ",", "channel", "future", "future", ")", "{", "switch", "(", "stream", "state", "(", ")", ")", "{", "case", "half", "closed", "local", ":", "case", "open", ":", "stream", "close", "local", "side", "(", ")", ";", "break", ";", "default", ":", "close", "stream", "(", "stream", ",", "future", ")", ";", "break", ";", "}", "}" ]
[ "returns", "true", "if", "this", "type", "is", "a", "supertype", "of", "the", "given", "{", "@", "code", "type", "}", "\"", "supertype", "\"", "is", "defined", "according", "to", "<", "a", "href", "=", "\"", "http", ":", "docs", "oracle", "comjavasespecsjlsse", "8htmljls", "-", "4", "html", "#", "jls", "-", "4", "5", "1", "\"", ">", "the", "rules", "for", "type", "arguments", "introduced", "with", "java", "generics" ]
[ "public", "final", "boolean", "is", "supertype", "of", "(", "type", "type", ")", "{", "return", "of", "(", "type", ")", "is", "subtype", "of", "(", "get", "type", "(", ")", ")", ";", "}" ]
[ "for", "restored", "state", ",", "register", "a", "new", "serializer", "that", "potentially", "has", "a", "new", "serialization", "schema", "users", "are", "allowed", "to", "register", "serializers", "for", "state", "only", "once", "therefore", ",", "this", "method", "is", "irrelevant", "if", "this", "provider", "was", "created", "with", "a", "serializer", "instance", ",", "since", "a", "state", "serializer", "had", "been", "registered", "already", "for", "the", "case", "where", "this", "provider", "was", "created", "from", "a", "serializer", "snapshot", ",", "then", "this", "method", "should", "be", "called", "at", "most", "once", "the", "new", "serializer", "will", "be", "checked", "for", "its", "schema", "compatibility", "with", "the", "previous", "serializer", "'", "s", "schema", ",", "and", "returned", "to", "the", "caller", "the", "caller", "is", "responsible", "for", "checking", "the", "result", "and", "react", "appropriately", "to", "it", ",", "as", "follows", ":", "{", "@", "link", "type", "serializer", "schema", "compatibility", "#", "is", "compatible", "as", "is", "(", ")", "}", ":", "nothing", "needs", "to", "be", "done", "{", "@", "link", "#", "current", "schema", "serializer", "(", ")", "}", "now", "returns", "the", "newly", "registered", "serializer", "{", "@", "link", "type", "serializer", "schema", "compatibility", "#", "is", "compatible", "after", "migration", "(", ")", "}", "(", ")", "}", ":", "state", "needs", "to", "be", "migrated", "before", "the", "serializer", "returned", "by", "{", "@", "link", "#", "current", "schema", "serializer", "(", ")", "}", "can", "be", "used", "the", "migration", "should", "be", "performed", "by", "reading", "the", "state", "with", "{", "@", "link", "#", "previous", "schema", "serializer", "(", ")", "}", ",", "and", "then", "writing", "it", "again", "with", "{", "@", "link", "#", "current", "schema", "serializer", "(", ")", "}", "{", "@", "link", "type", "serializer", "schema", "compatibility", "#", "is", "incompatible", "(", ")", "}", ":", "the", "registered", "serializer", "is", "incompatible", "{", "@", "link", "#", "current", "schema", "serializer", "(", ")", "}", "can", "no", "longer", "return", "a", "serializer", "for", "the", "state", ",", "and", "therefore", "this", "provider", "shouldn", "'", "t", "be", "used", "anymore" ]
[ "public", "abstract", "type", "serializer", "schema", "compatibility", "<", "t", ">", "register", "new", "serializer", "for", "restored", "state", "(", "type", "serializer", "<", "t", ">", "new", "serializer", ")", ";" ]
[ "this", "test", "validates", "the", "correctness", "of", "get", "cluster", "metrics", "in", "case", "the", "cluster", "is", "composed", "of", "only", "1", "bad", "sub", "cluster", "and", "a", "good", "one", "the", "good", "sub", "cluster", "provided", "a", "cluster", "metrics", "info", "with", "apps", "submitted", "set", "to", "its", "sub", "cluster", "id", "the", "expected", "result", "would", "be", "app", "submitted", "equals", "to", "its", "sub", "cluster", "id", "sub", "cluster", "id", "in", "this", "case", "is", "an", "integer" ]
[ "public", "void", "test", "get", "cluster", "metrics", "one", "bad", "one", "good", "(", ")", "throws", "yarn", "exception", ",", "i", "o", "exception", ",", "interrupted", "exception", "{", "setup", "cluster", "(", "arrays", "as", "list", "(", "good", ",", "bad", "2", ")", ")", ";", "cluster", "metrics", "info", "response", "=", "interceptor", "get", "cluster", "metrics", "info", "(", ")", ";", "assert", "assert", "not", "null", "(", "response", ")", ";", "check", "metrics", "from", "good", "s", "c", "(", "response", ")", ";", "/", "/", "the", "merge", "operations", "is", "tested", "in", "test", "router", "web", "service", "util", "}" ]
[ "to", "ticket", "expiration", "policy" ]
[ "public", "expiration", "policy", "to", "ticket", "expiration", "policy", "(", ")", "{", "val", "oauth", "=", "cas", "properties", "get", "authn", "(", ")", "get", "oauth", "(", ")", "get", "device", "token", "(", ")", ";", "return", "new", "o", "auth", "2", "0", "device", "token", "expiration", "policy", "(", "beans", "new", "duration", "(", "oauth", "get", "max", "time", "to", "live", "in", "seconds", "(", ")", ")", "get", "seconds", "(", ")", ")", ";", "}" ]
[ "checks", "for", "egl", "errors" ]
[ "private", "void", "check", "egl", "error", "(", "string", "msg", ")", "throws", "transcoding", "exception", "{", "boolean", "failed", "=", "false", ";", "int", "error", ";", "while", "(", "(", "error", "=", "m", "e", "g", "l", "egl", "get", "error", "(", ")", ")", "!", "=", "egl10", "egl", "success", ")", "{", "log", "e", "(", "tag", ",", "msg", "+", "\"", ":", "egl", "error", ":", "0x", "\"", "+", "integer", "to", "hex", "string", "(", "error", ")", ")", ";", "failed", "=", "true", ";", "}", "if", "(", "failed", ")", "{", "throw", "new", "transcoding", "exception", "(", "\"", "egl", "error", "encountered", "(", "see", "log", ")", "\"", ")", ";", "}", "}" ]
[ "clears", "the", "properties", "in", "the", "given", "range", "(", "inclusive", ")" ]
[ "public", "void", "clear", "properties", "(", "address", "start", ",", "address", "end", ",", "task", "monitor", "monitor", ")", "throws", "cancelled", "exception", "{", "property", "map", "mgr", "remove", "all", "(", "start", ",", "end", ",", "monitor", ")", ";", "}" ]
[ "release", "some", "bytes", "that", "we", "'", "re", "using" ]
[ "long", "release", "(", "long", "count", ")", "{", "return", "mem", "cache", "stats", "release", "(", "count", ")", ";", "}" ]
[ "adds", "{", "@", "code", "node", "}", "if", "it", "is", "not", "already", "present", "<", "b", ">", "nodes", "must", "be", "unique", "<", "b", ">", ",", "just", "as", "{", "@", "code", "map", "}", "keys", "must", "be", "they", "must", "also", "be", "non", "-", "null" ]
[ "public", "immutable", "value", "graph", "builder", "<", "n", ",", "v", ">", "add", "node", "(", "n", "node", ")", "{", "mutable", "value", "graph", "add", "node", "(", "node", ")", ";", "return", "this", ";", "}" ]
[ "called", "when", "the", "all", "of", "the", "component", "services", "have", "reached", "a", "terminal", "state", ",", "either", "{", "@", "linkplain", "state", "#", "terminated", "terminated", "}", "or", "{", "@", "linkplain", "state", "#", "failed", "failed", "}" ]
[ "public", "void", "stopped", "(", ")", "{", "}" ]
[ "called", "by", "the", "connection", "handling", "thread", "to", "execute", "the", "protocol" ]
[ "public", "abstract", "void", "handle", "(", "socket", "socket", ")", "throws", "i", "o", "exception", ",", "interrupted", "exception", ";" ]
[ "get", "the", "parent", "die", "of", "this", "die" ]
[ "public", "debug", "info", "entry", "get", "parent", "(", ")", "{", "return", "(", "parent", "offset", "!", "=", "-", "1", ")", "?", "compilation", "unit", "get", "program", "(", ")", "get", "entry", "at", "byte", "offset", "unchecked", "(", "parent", "offset", ")", ":", "null", ";", "}" ]
[ "execute", "a", "query", "based", "on", "the", "given", "hibernate", "criteria", "object" ]
[ "list", "<", "?", ">", "find", "by", "criteria", "(", "detached", "criteria", "criteria", ",", "int", "first", "result", ",", "int", "max", "results", ")", "throws", "data", "access", "exception", ";" ]
[ "replaces", "the", "last", "insn", "in", "this", "block", "the", "provided", "insn", "must", "have", "some", "branchingness" ]
[ "public", "void", "replace", "last", "insn", "(", "insn", "insn", ")", "{", "if", "(", "insn", "get", "opcode", "(", ")", "get", "branchingness", "(", ")", "=", "=", "rop", "branch", "none", ")", "{", "throw", "new", "illegal", "argument", "exception", "(", "\"", "last", "insn", "must", "branch", "\"", ")", ";", "}", "ssa", "insn", "old", "insn", "=", "insns", "get", "(", "insns", "size", "(", ")", "-", "1", ")", ";", "ssa", "insn", "new", "insn", "=", "ssa", "insn", "make", "from", "rop", "(", "insn", ",", "this", ")", ";", "insns", "set", "(", "insns", "size", "(", ")", "-", "1", ",", "new", "insn", ")", ";", "parent", "on", "insn", "removed", "(", "old", "insn", ")", ";", "parent", "on", "insn", "added", "(", "new", "insn", ")", ";", "}" ]
[ "this", "test", "is", "specific", "to", "internal", "sps", "so", ",", "ignoring", "it" ]
[ "public", "void", "test", "traverse", "when", "parent", "deleted", "(", ")", "throws", "exception", "{", "}" ]
[ "returns", "pet", "inventories", "by", "status", "returns", "a", "map", "of", "status", "codes", "to", "quantities", "<", "b", ">", "200", "<", "b", ">", "-", "successful", "operation" ]
[ "public", "map", "<", "string", ",", "integer", ">", "get", "inventory", "(", "map", "<", "string", ",", "object", ">", "params", ")", "throws", "i", "o", "exception", "{", "http", "response", "response", "=", "get", "inventory", "for", "http", "response", "(", "params", ")", ";", "type", "reference", "<", "map", "<", "string", ",", "integer", ">", ">", "type", "ref", "=", "new", "type", "reference", "<", "map", "<", "string", ",", "integer", ">", ">", "(", ")", "{", "}", ";", "return", "api", "client", "get", "object", "mapper", "(", ")", "read", "value", "(", "response", "get", "content", "(", ")", ",", "type", "ref", ")", ";", "}" ]
[ "constructs", "a", "simple", "document", "with", "a", "field", "name", "and", "value", "pairs", "<", "b", ">", "note", ":", "the", "number", "of", "objects", "passed", "to", "this", "method", "must", "be", "an", "even", "number", "also", "the", "first", "argument", "in", "each", "pair", "(", "the", "field", "name", ")", "must", "have", "a", "valid", "string", "representation", "<", "b", ">" ]
[ "public", "index", "request", "builder", "set", "source", "(", "object", "source", ")", "{", "request", "source", "(", "source", ")", ";", "return", "this", ";", "}" ]
[ "test", "the", "case", "when", "{", "@", "code", "io", "serializations", "key", "}", "is", "not", "set", "at", "all", ",", "because", "something", "unset", "this", "key", "this", "shouldn", "'", "t", "result", "in", "any", "error", ",", "the", "defaults", "present", "in", "construction", "should", "be", "used", "in", "this", "case" ]
[ "public", "void", "test", "serialization", "key", "is", "unset", "(", ")", "{", "configuration", "conf", "=", "new", "configuration", "(", ")", ";", "conf", "unset", "(", "common", "configuration", "keys", "io", "serializations", "key", ")", ";", "serialization", "factory", "factory", "=", "new", "serialization", "factory", "(", "conf", ")", ";", "}" ]
[ "map", "the", "route", "for", "http", "head", "requests" ]
[ "public", "static", "void", "head", "(", "string", "path", ",", "route", "route", ",", "response", "transformer", "transformer", ")", "{", "get", "instance", "(", ")", "head", "(", "path", ",", "route", ",", "transformer", ")", ";", "}" ]
[ "sets", "up", "the", "valid", "names", "for", "stack", "register", "based", "spaces", "the", "symbolic", "stack", "spaces", "are", "named", "based", "on", "the", "register", "used", "to", "store", "things", "into", "the", "symbolic", "space" ]
[ "private", "void", "setup", "valid", "symbolic", "stack", "names", "(", "program", "program", ")", "{", "/", "/", "figure", "out", "what", "register", "is", "used", "for", "stack", "values", "register", "stack", "register", "=", "get", "stack", "register", "(", ")", ";", "valid", "symbolic", "stack", "names", "add", "(", "stack", "register", "get", "name", "(", ")", ")", ";", "list", "<", "register", ">", "child", "registers", "=", "stack", "register", "get", "child", "registers", "(", ")", ";", "for", "(", "register", "register", ":", "child", "registers", ")", "{", "valid", "symbolic", "stack", "names", "add", "(", "register", "get", "name", "(", ")", ")", ";", "}", "}" ]
[ "retriggers", "a", "remote", "subpartition", "request" ]
[ "void", "retrigger", "subpartition", "request", "(", "int", "subpartition", "index", ")", "throws", "i", "o", "exception", "{", "check", "partition", "request", "queue", "initialized", "(", ")", ";", "if", "(", "increase", "backoff", "(", ")", ")", "{", "partition", "request", "client", "request", "subpartition", "(", "partition", "id", ",", "subpartition", "index", ",", "this", ",", "get", "current", "backoff", "(", ")", ")", ";", "}", "else", "{", "fail", "partition", "request", "(", ")", ";", "}", "}" ]
[ "execute", "a", "query", "based", "on", "a", "given", "hibernate", "criteria", "object" ]
[ "list", "<", "?", ">", "find", "by", "criteria", "(", "detached", "criteria", "criteria", ")", "throws", "data", "access", "exception", ";" ]
[ "pick", "a", "{", "@", "link", "sub", "agg", "collection", "mode", "}", "based", "on", "heuristics", "about", "what", "we", "'", "re", "collecting" ]
[ "static", "sub", "agg", "collection", "mode", "pick", "sub", "agg", "colect", "mode", "(", "aggregator", "factories", "factories", ",", "int", "expected", "size", ",", "long", "max", "ord", ")", "{", "if", "(", "factories", "count", "aggregators", "(", ")", "=", "=", "0", ")", "{", "/", "/", "without", "sub", "-", "aggregations", "we", "pretty", "much", "ignore", "this", "field", "value", "so", "just", "pick", "something", "return", "sub", "agg", "collection", "mode", "depth", "first", ";", "}", "if", "(", "expected", "size", "=", "=", "integer", "max", "value", ")", "{", "/", "/", "we", "expect", "to", "return", "all", "buckets", "so", "delaying", "them", "won", "'", "t", "save", "any", "time", "return", "sub", "agg", "collection", "mode", "depth", "first", ";", "}", "if", "(", "max", "ord", "=", "=", "-", "1", "|", "|", "max", "ord", ">", "expected", "size", ")", "{", "/", "*", "*", "we", "either", "don", "'", "t", "know", "how", "many", "buckets", "we", "expect", "there", "to", "be", "*", "(", "max", "ord", "=", "=", "-", "1", ")", "or", "we", "expect", "there", "to", "be", "more", "buckets", "than", "*", "we", "will", "collect", "from", "this", "shard", "so", "delaying", "collection", "of", "*", "the", "sub", "-", "buckets", "*", "should", "*", "save", "time", "*", "/", "return", "sub", "agg", "collection", "mode", "breadth", "first", ";", "}", "/", "/", "we", "expect", "to", "collect", "so", "many", "buckets", "that", "we", "may", "as", "well", "collect", "them", "all", "return", "sub", "agg", "collection", "mode", "depth", "first", ";", "}" ]
[ "resizes", "the", "hashtable", "to", "allow", "more", "entries" ]
[ "private", "void", "grow", "(", ")", "{", "capacity", "=", "indexer", "get", "capacity", "(", ")", ";", "object", "[", "]", "old", "values", "=", "values", ";", "values", "=", "new", "object", "[", "capacity", "]", ";", "system", "arraycopy", "(", "old", "values", ",", "0", ",", "values", ",", "0", ",", "old", "values", "length", ")", ";", "}" ]
[ "throws", "a", "{", "@", "link", "java", "lang", "unsupported", "operation", "exception", "}" ]
[ "public", "void", "remove", "(", ")", "{", "throw", "new", "unsupported", "operation", "exception", "(", ")", ";", "}" ]
[ "return", "true", "if", "this", "read", "only", "first", "object", "is", "equal", "to", "o" ]
[ "public", "boolean", "equals", "(", "object", "o", ")", "{", "if", "(", "this", "=", "=", "o", ")", "{", "return", "true", ";", "}", "if", "(", "o", "=", "=", "null", "|", "|", "get", "class", "(", ")", "!", "=", "o", "get", "class", "(", ")", ")", "{", "return", "false", ";", "}", "read", "only", "first", "read", "only", "first", "=", "(", "read", "only", "first", ")", "o", ";", "return", "objects", "equals", "(", "this", "bar", ",", "read", "only", "first", "bar", ")", "&", "&", "objects", "equals", "(", "this", "baz", ",", "read", "only", "first", "baz", ")", ";", "}" ]
[ "create", "a", "builder", "with", "the", "given", "status" ]
[ "public", "static", "body", "builder", "status", "(", "int", "status", ")", "{", "return", "new", "default", "builder", "(", "status", ")", ";", "}" ]
[ "determine", "the", "font", "and", "color", "to", "use", "to", "render", "an", "operand", "when", "that", "operand", "is", "a", "reference" ]
[ "private", "color", "style", "attributes", "get", "address", "attributes", "(", "code", "unit", "cu", ",", "address", "dest", "addr", ",", "int", "op", "index", ",", "program", "program", ")", "{", "if", "(", "dest", "addr", "=", "=", "null", ")", "{", "return", "separator", "attributes", ";", "}", "if", "(", "dest", "addr", "is", "memory", "address", "(", ")", "&", "&", "!", "program", "get", "memory", "(", ")", "contains", "(", "dest", "addr", ")", ")", "{", "return", "bad", "ref", "attributes", ";", "}", "symbol", "table", "st", "=", "program", "get", "symbol", "table", "(", ")", ";", "reference", "manager", "ref", "mgr", "=", "program", "get", "reference", "manager", "(", ")", ";", "reference", "ref", "=", "ref", "mgr", "get", "reference", "(", "cu", "get", "min", "address", "(", ")", ",", "dest", "addr", ",", "op", "index", ")", ";", "symbol", "sym", "=", "st", "get", "symbol", "(", "ref", ")", ";", "if", "(", "sym", "!", "=", "null", ")", "{", "inspector", "set", "program", "(", "program", ")", ";", "color", "style", "attributes", "new", "attributes", "=", "new", "color", "style", "attributes", "(", ")", ";", "color", "and", "style", "c", "=", "inspector", "get", "color", "and", "style", "(", "sym", ")", ";", "new", "attributes", "color", "attribute", "=", "c", "get", "color", "(", ")", ";", "new", "attributes", "style", "attribute", "=", "c", "get", "style", "(", ")", ";", "return", "new", "attributes", ";", "}", "return", "address", "attributes", ";", "}" ]
[ "decodes", "the", "specified", "region", "of", "the", "buffer", "into", "an", "unadjusted", "frame", "length", "the", "default", "implementation", "is", "capable", "of", "decoding", "the", "specified", "region", "into", "an", "unsigned", "816243264", "bit", "integer", "override", "this", "method", "to", "decode", "the", "length", "field", "encoded", "differently", "note", "that", "this", "method", "must", "not", "modify", "the", "state", "of", "the", "specified", "buffer", "(", "e", "g", "{", "@", "code", "reader", "index", "}", ",", "{", "@", "code", "writer", "index", "}", ",", "and", "the", "content", "of", "the", "buffer", ")" ]
[ "protected", "long", "get", "unadjusted", "frame", "length", "(", "byte", "buf", "buf", ",", "int", "offset", ",", "int", "length", ",", "byte", "order", "order", ")", "{", "buf", "=", "buf", "order", "(", "order", ")", ";", "long", "frame", "length", ";", "switch", "(", "length", ")", "{", "case", "1", ":", "frame", "length", "=", "buf", "get", "unsigned", "byte", "(", "offset", ")", ";", "break", ";", "case", "2", ":", "frame", "length", "=", "buf", "get", "unsigned", "short", "(", "offset", ")", ";", "break", ";", "case", "3", ":", "frame", "length", "=", "buf", "get", "unsigned", "medium", "(", "offset", ")", ";", "break", ";", "case", "4", ":", "frame", "length", "=", "buf", "get", "unsigned", "int", "(", "offset", ")", ";", "break", ";", "case", "8", ":", "frame", "length", "=", "buf", "get", "long", "(", "offset", ")", ";", "break", ";", "default", ":", "throw", "new", "decoder", "exception", "(", "\"", "unsupported", "length", "field", "length", ":", "\"", "+", "length", "field", "length", "+", "\"", "(", "expected", ":", "1", ",", "2", ",", "3", ",", "4", ",", "or", "8", ")", "\"", ")", ";", "}", "return", "frame", "length", ";", "}" ]
[ "tests", "that", "a", "roll", "up", "job", "created", "on", "a", "old", "cluster", "is", "correctly", "restarted", "after", "the", "upgrade" ]
[ "public", "void", "test", "rollup", "after", "restart", "(", ")", "throws", "exception", "{", "if", "(", "is", "running", "against", "old", "cluster", "(", ")", ")", "{", "final", "int", "num", "docs", "=", "59", ";", "final", "int", "year", "=", "random", "int", "between", "(", "1970", ",", "2018", ")", ";", "/", "/", "index", "documents", "for", "the", "rollup", "job", "final", "string", "builder", "bulk", "=", "new", "string", "builder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "num", "docs", ";", "i", "+", "+", ")", "{", "bulk", "append", "(", "\"", "{", "\\", "\"", "index", "\\", "\"", ":", "{", "\\", "\"", "index", "\\", "\"", ":", "\\", "\"", "rollup", "-", "docs", "\\", "\"", "}", "}", "\\", "n", "\"", ")", ";", "string", "date", "=", "string", "format", "(", "locale", "root", ",", "\"", "%", "0", "4d", "-", "01", "-", "01t00", ":", "%", "0", "2d", ":", "00z", "\"", ",", "year", ",", "i", ")", ";", "bulk", "append", "(", "\"", "{", "\\", "\"", "timestamp", "\\", "\"", ":", "\\", "\"", "\"", ")", "append", "(", "date", ")", "append", "(", "\"", "\\", "\"", ",", "\\", "\"", "value", "\\", "\"", ":", "\"", ")", "append", "(", "i", ")", "append", "(", "\"", "}", "\\", "n", "\"", ")", ";", "}", "bulk", "append", "(", "\"", "\\", "r", "\\", "n", "\"", ")", ";", "final", "request", "bulk", "request", "=", "new", "request", "(", "\"", "post", "\"", ",", "\"", "/", "bulk", "\"", ")", ";", "bulk", "request", "set", "json", "entity", "(", "bulk", "to", "string", "(", ")", ")", ";", "client", "(", ")", "perform", "request", "(", "bulk", "request", ")", ";", "/", "/", "create", "the", "rollup", "job", "final", "request", "create", "rollup", "job", "request", "=", "new", "request", "(", "\"", "put", "\"", ",", "\"", "/", "rollup", "/", "job", "/", "rollup", "-", "job", "-", "test", "\"", ")", ";", "string", "interval", "type", ";", "if", "(", "get", "old", "cluster", "version", "(", ")", "on", "or", "after", "(", "version", "v", "7", "2", "0", ")", ")", "{", "interval", "type", "=", "\"", "fixed", "interval", "\"", ";", "}", "else", "{", "interval", "type", "=", "\"", "interval", "\"", ";", "}", "create", "rollup", "job", "request", "set", "json", "entity", "(", "\"", "{", "\"", "+", "\"", "\\", "\"", "index", "pattern", "\\", "\"", ":", "\\", "\"", "rollup", "-", "*", "\\", "\"", ",", "\"", "+", "\"", "\\", "\"", "rollup", "index", "\\", "\"", ":", "\\", "\"", "results", "-", "rollup", "\\", "\"", ",", "\"", "+", "\"", "\\", "\"", "cron", "\\", "\"", ":", "\\", "\"", "*", "/", "30", "*", "*", "*", "*", "?", "\\", "\"", ",", "\"", "+", "\"", "\\", "\"", "page", "size", "\\", "\"", ":", "100", ",", "\"", "+", "\"", "\\", "\"", "groups", "\\", "\"", ":", "{", "\"", "+", "\"", "\\", "\"", "date", "histogram", "\\", "\"", ":", "{", "\"", "+", "\"", "\\", "\"", "field", "\\", "\"", ":", "\\", "\"", "timestamp", "\\", "\"", ",", "\"", "+", "\"", "\\", "\"", "\"", "+", "interval", "type", "+", "\"", "\\", "\"", ":", "\\", "\"", "5m", "\\", "\"", "\"", "+", "\"", "}", "\"", "+", "\"", "}", ",", "\"", "+", "\"", "\\", "\"", "metrics", "\\", "\"", ":", "[", "\"", "+", "\"", "{", "\\", "\"", "field", "\\", "\"", ":", "\\", "\"", "value", "\\", "\"", ",", "\\", "\"", "metrics", "\\", "\"", ":", "[", "\\", "\"", "min", "\\", "\"", ",", "\\", "\"", "max", "\\", "\"", ",", "\\", "\"", "sum", "\\", "\"", "]", "}", "\"", "+", "\"", "]", "\"", "+", "\"", "}", "\"", ")", ";", "map", "<", "string", ",", "object", ">", "create", "rollup", "job", "response", "=", "entity", "as", "map", "(", "client", "(", ")", "perform", "request", "(", "create", "rollup", "job", "request", ")", ")", ";", "assert", "that", "(", "create", "rollup", "job", "response", "get", "(", "\"", "acknowledged", "\"", ")", ",", "equal", "to", "(", "boolean", "true", ")", ")", ";", "/", "/", "start", "the", "rollup", "job", "final", "request", "start", "rollup", "job", "request", "=", "new", "request", "(", "\"", "post", "\"", ",", "\"", "/", "rollup", "/", "job", "/", "rollup", "-", "job", "-", "test", "/", "start", "\"", ")", ";", "map", "<", "string", ",", "object", ">", "start", "rollup", "job", "response", "=", "entity", "as", "map", "(", "client", "(", ")", "perform", "request", "(", "start", "rollup", "job", "request", ")", ")", ";", "assert", "that", "(", "start", "rollup", "job", "response", "get", "(", "\"", "started", "\"", ")", ",", "equal", "to", "(", "boolean", "true", ")", ")", ";", "assert", "roll", "up", "job", "(", "\"", "rollup", "-", "job", "-", "test", "\"", ")", ";", "}", "else", "{", "final", "request", "cluster", "health", "request", "=", "new", "request", "(", "\"", "get", "\"", ",", "\"", "/", "cluster", "/", "health", "\"", ")", ";", "cluster", "health", "request", "add", "parameter", "(", "\"", "wait", "for", "status", "\"", ",", "\"", "yellow", "\"", ")", ";", "cluster", "health", "request", "add", "parameter", "(", "\"", "wait", "for", "no", "relocating", "shards", "\"", ",", "\"", "true", "\"", ")", ";", "cluster", "health", "request", "add", "parameter", "(", "\"", "wait", "for", "no", "initializing", "shards", "\"", ",", "\"", "true", "\"", ")", ";", "map", "<", "string", ",", "object", ">", "cluster", "health", "response", "=", "entity", "as", "map", "(", "client", "(", ")", "perform", "request", "(", "cluster", "health", "request", ")", ")", ";", "assert", "that", "(", "cluster", "health", "response", "get", "(", "\"", "timed", "out", "\"", ")", ",", "equal", "to", "(", "boolean", "false", ")", ")", ";", "assert", "roll", "up", "job", "(", "\"", "rollup", "-", "job", "-", "test", "\"", ")", ";", "}", "}" ]
[ "returns", "a", "new", "array", "containing", "the", "remaining", "keys" ]
[ "public", "array", "<", "k", ">", "to", "array", "(", ")", "{", "return", "to", "array", "(", "new", "array", "<", "k", ">", "(", "true", ",", "map", "size", ")", ")", ";", "}" ]
[ "build", "the", "balance", "job" ]
[ "public", "balance", "job", "build", "(", ")", "throws", "i", "o", "exception", "{", "/", "/", "construct", "job", "context", "fed", "balance", "context", "context", ";", "path", "dst", "=", "new", "path", "(", "input", "dst", ")", ";", "if", "(", "dst", "to", "uri", "(", ")", "get", "authority", "(", ")", "=", "=", "null", ")", "{", "throw", "new", "i", "o", "exception", "(", "\"", "the", "destination", "cluster", "must", "be", "specified", "\"", ")", ";", "}", "path", "src", "=", "get", "src", "path", "(", "input", "src", ")", ";", "string", "mount", "=", "input", "src", ";", "context", "=", "new", "fed", "balance", "context", "builder", "(", "src", ",", "dst", ",", "mount", ",", "get", "conf", "(", ")", ")", "set", "force", "close", "open", "files", "(", "force", "close", "open", ")", "set", "use", "mount", "read", "only", "(", "true", ")", "set", "map", "num", "(", "map", ")", "set", "bandwidth", "limit", "(", "bandwidth", ")", "set", "trash", "(", "trash", "opt", ")", "set", "delay", "duration", "(", "delay", "duration", ")", "set", "diff", "threshold", "(", "diff", "threshold", ")", "build", "(", ")", ";", "log", "info", "(", "context", "to", "string", "(", ")", ")", ";", "/", "/", "construct", "the", "balance", "job", "balance", "job", "builder", "<", "balance", "procedure", ">", "builder", "=", "new", "balance", "job", "builder", "<", ">", "(", ")", ";", "router", "dist", "cp", "procedure", "dcp", "=", "new", "router", "dist", "cp", "procedure", "(", "distcp", "procedure", ",", "null", ",", "delay", "duration", ",", "context", ")", ";", "builder", "next", "procedure", "(", "dcp", ")", ";", "mount", "table", "procedure", "mtp", "=", "new", "mount", "table", "procedure", "(", "mount", "table", "procedure", ",", "null", ",", "delay", "duration", ",", "input", "src", ",", "dst", "to", "uri", "(", ")", "get", "path", "(", ")", ",", "dst", "to", "uri", "(", ")", "get", "authority", "(", ")", ",", "get", "conf", "(", ")", ")", ";", "builder", "next", "procedure", "(", "mtp", ")", ";", "trash", "procedure", "tp", "=", "new", "trash", "procedure", "(", "trash", "procedure", ",", "null", ",", "delay", "duration", ",", "context", ")", ";", "builder", "next", "procedure", "(", "tp", ")", ";", "return", "builder", "build", "(", ")", ";", "}" ]
[ "returns", "trash", "root", "in", "a", "snapshottable", "directory" ]
[ "public", "static", "string", "get", "snapshot", "trash", "root", "(", "string", "ss", "root", ",", "user", "group", "information", "ugi", ")", "{", "return", "(", "ss", "root", "equals", "(", "\"", "/", "\"", ")", "?", "ss", "root", ":", "ss", "root", "+", "path", "separator", ")", "+", "file", "system", "trash", "prefix", "+", "path", "separator", "+", "ugi", "get", "short", "user", "name", "(", ")", ";", "}" ]
[ "gets", "security", "token", "from", "request" ]
[ "protected", "security", "token", "get", "security", "token", "from", "request", "(", "final", "http", "servlet", "request", "request", ")", "{", "val", "cookie", "value", "=", "config", "context", "get", "ticket", "granting", "ticket", "cookie", "generator", "(", ")", "retrieve", "cookie", "value", "(", "request", ")", ";", "if", "(", "string", "utils", "is", "not", "blank", "(", "cookie", "value", ")", ")", "{", "val", "tgt", "=", "config", "context", "get", "ticket", "registry", "(", ")", "get", "ticket", "(", "cookie", "value", ",", "ticket", "granting", "ticket", "class", ")", ";", "if", "(", "tgt", "!", "=", "null", ")", "{", "val", "sts", "=", "tgt", "get", "descendant", "tickets", "(", ")", "stream", "(", ")", "filter", "(", "t", "-", ">", "t", "starts", "with", "(", "security", "token", "ticket", "prefix", ")", ")", "find", "first", "(", ")", "or", "else", "(", "null", ")", ";", "if", "(", "string", "utils", "is", "not", "blank", "(", "sts", ")", ")", "{", "val", "stt", "=", "config", "context", "get", "ticket", "registry", "(", ")", "get", "ticket", "(", "sts", ",", "security", "token", "ticket", "class", ")", ";", "if", "(", "stt", "=", "=", "null", "|", "|", "stt", "is", "expired", "(", ")", ")", "{", "logger", "warn", "(", "\"", "security", "token", "ticket", "[", "{", "}", "]", "is", "not", "found", "or", "has", "expired", "\"", ",", "sts", ")", ";", "return", "null", ";", "}", "if", "(", "stt", "get", "security", "token", "(", ")", "is", "expired", "(", ")", ")", "{", "logger", "warn", "(", "\"", "security", "token", "linked", "to", "ticket", "[", "{", "}", "]", "has", "expired", "\"", ",", "sts", ")", ";", "return", "null", ";", "}", "return", "stt", "get", "security", "token", "(", ")", ";", "}", "}", "}", "return", "null", ";", "}" ]
[ "register", "a", "values", "source", "to", "aggregator", "mapping", "this", "method", "registers", "mappings", "that", "only", "apply", "to", "a", "single", "{", "@", "link", "values", "source", "type", "}" ]
[ "public", "<", "t", ">", "void", "register", "(", "registry", "key", "<", "t", ">", "registry", "key", ",", "values", "source", "type", "values", "source", "type", ",", "t", "aggregator", "supplier", ",", "boolean", "register", "usage", ")", "{", "if", "(", "aggregator", "registry", "contains", "key", "(", "registry", "key", ")", "=", "=", "false", ")", "{", "aggregator", "registry", "put", "(", "registry", "key", ",", "new", "array", "list", "<", ">", "(", ")", ")", ";", "}", "aggregator", "registry", "get", "(", "registry", "key", ")", "add", "(", "new", "abstract", "map", "simple", "entry", "<", ">", "(", "values", "source", "type", ",", "aggregator", "supplier", ")", ")", ";", "if", "(", "register", "usage", ")", "{", "register", "usage", "(", "registry", "key", "get", "name", "(", ")", ",", "values", "source", "type", ")", ";", "}", "}" ]
[ "host", "views", "implement", "their", "own", "content", "description", "handling", "instead", "of", "just", "delegating", "to", "the", "underlying", "view", "framework", "for", "performance", "reasons", "as", "the", "framework", "setsresets", "content", "description", "very", "frequently", "on", "host", "views", "and", "the", "underlying", "accessibility", "notifications", "might", "cause", "performance", "issues", "this", "is", "safe", "to", "do", "because", "the", "framework", "owns", "the", "accessibility", "state", "and", "knows", "how", "to", "update", "it", "efficiently" ]
[ "public", "void", "set", "content", "description", "(", "@", "nullable", "char", "sequence", "content", "description", ")", "{", "m", "content", "description", "=", "content", "description", ";", "if", "(", "!", "text", "utils", "is", "empty", "(", "content", "description", ")", "&", "&", "view", "compat", "get", "important", "for", "accessibility", "(", "this", ")", "=", "=", "view", "compat", "important", "for", "accessibility", "auto", ")", "{", "view", "compat", "set", "important", "for", "accessibility", "(", "this", ",", "view", "compat", "important", "for", "accessibility", "yes", ")", ";", "}", "maybe", "invalidate", "accessibility", "state", "(", ")", ";", "}" ]