id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
160,800
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/popup/ActivityDataIOEditorWidget.java
ActivityDataIOEditorWidget.isDuplicateName
public boolean isDuplicateName(String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { ...
java
public boolean isDuplicateName(String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { ...
[ "public", "boolean", "isDuplicateName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "List", "<", "AssignmentRow", ">", "as", ...
Tests whether a Row name occurs more than once in the list of rows @param name @return
[ "Tests", "whether", "a", "Row", "name", "occurs", "more", "than", "once", "in", "the", "list", "of", "rows" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/popup/ActivityDataIOEditorWidget.java#L221-L238
160,801
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/ListBoxValues.java
ListBoxValues.getValueForDisplayValue
public String getValueForDisplayValue(final String key) { if (mapDisplayValuesToValues.containsKey(key)) { return mapDisplayValuesToValues.get(key); } return key; }
java
public String getValueForDisplayValue(final String key) { if (mapDisplayValuesToValues.containsKey(key)) { return mapDisplayValuesToValues.get(key); } return key; }
[ "public", "String", "getValueForDisplayValue", "(", "final", "String", "key", ")", "{", "if", "(", "mapDisplayValuesToValues", ".", "containsKey", "(", "key", ")", ")", "{", "return", "mapDisplayValuesToValues", ".", "get", "(", "key", ")", ";", "}", "return",...
Returns real unquoted value for a DisplayValue @param key @return
[ "Returns", "real", "unquoted", "value", "for", "a", "DisplayValue" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/ListBoxValues.java#L275-L280
160,802
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/AssignmentData.java
AssignmentData.getAssignmentRows
public List<AssignmentRow> getAssignmentRows(VariableType varType) { List<AssignmentRow> rows = new ArrayList<AssignmentRow>(); List<Variable> handledVariables = new ArrayList<Variable>(); // Create an AssignmentRow for each Assignment for (Assignment assignment : assignments) { ...
java
public List<AssignmentRow> getAssignmentRows(VariableType varType) { List<AssignmentRow> rows = new ArrayList<AssignmentRow>(); List<Variable> handledVariables = new ArrayList<Variable>(); // Create an AssignmentRow for each Assignment for (Assignment assignment : assignments) { ...
[ "public", "List", "<", "AssignmentRow", ">", "getAssignmentRows", "(", "VariableType", "varType", ")", "{", "List", "<", "AssignmentRow", ">", "rows", "=", "new", "ArrayList", "<", "AssignmentRow", ">", "(", ")", ";", "List", "<", "Variable", ">", "handledVa...
Gets a list of AssignmentRows based on the current Assignments @return
[ "Gets", "a", "list", "of", "AssignmentRows", "based", "on", "the", "current", "Assignments" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/AssignmentData.java#L530-L567
160,803
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseJson
public static Diagram parseJson(String json, Boolean keepGlossaryLink) throws JSONException { JSONObject modelJSON = new JSONObject(json); return parseJson(modelJSON, keepGlossaryLink); }
java
public static Diagram parseJson(String json, Boolean keepGlossaryLink) throws JSONException { JSONObject modelJSON = new JSONObject(json); return parseJson(modelJSON, keepGlossaryLink); }
[ "public", "static", "Diagram", "parseJson", "(", "String", "json", ",", "Boolean", "keepGlossaryLink", ")", "throws", "JSONException", "{", "JSONObject", "modelJSON", "=", "new", "JSONObject", "(", "json", ")", ";", "return", "parseJson", "(", "modelJSON", ",", ...
Parse the json string to the diagram model, assumes that the json is hierarchical ordered @param json @return Model with all shapes defined in JSON @throws org.json.JSONException
[ "Parse", "the", "json", "string", "to", "the", "diagram", "model", "assumes", "that", "the", "json", "is", "hierarchical", "ordered" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L49-L54
160,804
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseJson
public static Diagram parseJson(JSONObject json, Boolean keepGlossaryLink) throws JSONException { ArrayList<Shape> shapes = new ArrayList<Shape>(); HashMap<String, JSONObject> flatJSON = flatRessources(json); for (String resourceId : flatJSON.keySet()) { ...
java
public static Diagram parseJson(JSONObject json, Boolean keepGlossaryLink) throws JSONException { ArrayList<Shape> shapes = new ArrayList<Shape>(); HashMap<String, JSONObject> flatJSON = flatRessources(json); for (String resourceId : flatJSON.keySet()) { ...
[ "public", "static", "Diagram", "parseJson", "(", "JSONObject", "json", ",", "Boolean", "keepGlossaryLink", ")", "throws", "JSONException", "{", "ArrayList", "<", "Shape", ">", "shapes", "=", "new", "ArrayList", "<", "Shape", ">", "(", ")", ";", "HashMap", "<...
do the parsing on an JSONObject, assumes that the json is hierarchical ordered, so all shapes are reachable over child relations @param json hierarchical JSON object @return Model with all shapes defined in JSON @throws org.json.JSONException
[ "do", "the", "parsing", "on", "an", "JSONObject", "assumes", "that", "the", "json", "is", "hierarchical", "ordered", "so", "all", "shapes", "are", "reachable", "over", "child", "relations" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L68-L105
160,805
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseRessource
private static void parseRessource(ArrayList<Shape> shapes, HashMap<String, JSONObject> flatJSON, String resourceId, Boolean keepGlossaryLink) throws JSONException { JSONObject modelJ...
java
private static void parseRessource(ArrayList<Shape> shapes, HashMap<String, JSONObject> flatJSON, String resourceId, Boolean keepGlossaryLink) throws JSONException { JSONObject modelJ...
[ "private", "static", "void", "parseRessource", "(", "ArrayList", "<", "Shape", ">", "shapes", ",", "HashMap", "<", "String", ",", "JSONObject", ">", "flatJSON", ",", "String", "resourceId", ",", "Boolean", "keepGlossaryLink", ")", "throws", "JSONException", "{",...
Parse one resource to a shape object and add it to the shapes array @param shapes @param flatJSON @param resourceId @throws org.json.JSONException
[ "Parse", "one", "resource", "to", "a", "shape", "object", "and", "add", "it", "to", "the", "shapes", "array" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L114-L142
160,806
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseStencil
private static void parseStencil(JSONObject modelJSON, Shape current) throws JSONException { // get stencil type if (modelJSON.has("stencil")) { JSONObject stencil = modelJSON.getJSONObject("stencil"); // TODO other attributes of stencil ...
java
private static void parseStencil(JSONObject modelJSON, Shape current) throws JSONException { // get stencil type if (modelJSON.has("stencil")) { JSONObject stencil = modelJSON.getJSONObject("stencil"); // TODO other attributes of stencil ...
[ "private", "static", "void", "parseStencil", "(", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "// get stencil type", "if", "(", "modelJSON", ".", "has", "(", "\"stencil\"", ")", ")", "{", "JSONObject", "stencil", "=",...
parse the stencil out of a JSONObject and set it to the current shape @param modelJSON @param current @throws org.json.JSONException
[ "parse", "the", "stencil", "out", "of", "a", "JSONObject", "and", "set", "it", "to", "the", "current", "shape" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L150-L162
160,807
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseStencilSet
private static void parseStencilSet(JSONObject modelJSON, Diagram current) throws JSONException { // get stencil type if (modelJSON.has("stencilset")) { JSONObject object = modelJSON.getJSONObject("stencilset"); String url = null; ...
java
private static void parseStencilSet(JSONObject modelJSON, Diagram current) throws JSONException { // get stencil type if (modelJSON.has("stencilset")) { JSONObject object = modelJSON.getJSONObject("stencilset"); String url = null; ...
[ "private", "static", "void", "parseStencilSet", "(", "JSONObject", "modelJSON", ",", "Diagram", "current", ")", "throws", "JSONException", "{", "// get stencil type", "if", "(", "modelJSON", ".", "has", "(", "\"stencilset\"", ")", ")", "{", "JSONObject", "object",...
crates a StencilSet object and add it to the current diagram @param modelJSON @param current @throws org.json.JSONException
[ "crates", "a", "StencilSet", "object", "and", "add", "it", "to", "the", "current", "diagram" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L170-L189
160,808
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseProperties
@SuppressWarnings("unchecked") private static void parseProperties(JSONObject modelJSON, Shape current, Boolean keepGlossaryLink) throws JSONException { if (modelJSON.has("properties")) { JSONObject propsObject = mod...
java
@SuppressWarnings("unchecked") private static void parseProperties(JSONObject modelJSON, Shape current, Boolean keepGlossaryLink) throws JSONException { if (modelJSON.has("properties")) { JSONObject propsObject = mod...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "void", "parseProperties", "(", "JSONObject", "modelJSON", ",", "Shape", "current", ",", "Boolean", "keepGlossaryLink", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has"...
create a HashMap form the json properties and add it to the shape @param modelJSON @param current @throws org.json.JSONException
[ "create", "a", "HashMap", "form", "the", "json", "properties", "and", "add", "it", "to", "the", "shape" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L197-L229
160,809
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseSsextensions
private static void parseSsextensions(JSONObject modelJSON, Diagram current) throws JSONException { if (modelJSON.has("ssextensions")) { JSONArray array = modelJSON.getJSONArray("ssextensions"); for (int i = 0; i < array.length(); i++) { ...
java
private static void parseSsextensions(JSONObject modelJSON, Diagram current) throws JSONException { if (modelJSON.has("ssextensions")) { JSONArray array = modelJSON.getJSONArray("ssextensions"); for (int i = 0; i < array.length(); i++) { ...
[ "private", "static", "void", "parseSsextensions", "(", "JSONObject", "modelJSON", ",", "Diagram", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"ssextensions\"", ")", ")", "{", "JSONArray", "array", "=", "modelJSON", ...
adds all json extension to an diagram @param modelJSON @param current @throws org.json.JSONException
[ "adds", "all", "json", "extension", "to", "an", "diagram" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L237-L245
160,810
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseOutgoings
private static void parseOutgoings(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("outgoing")) { ArrayList<Shape> outgoings = new ArrayList<Shape>(); JSON...
java
private static void parseOutgoings(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("outgoing")) { ArrayList<Shape> outgoings = new ArrayList<Shape>(); JSON...
[ "private", "static", "void", "parseOutgoings", "(", "ArrayList", "<", "Shape", ">", "shapes", ",", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"outgoing\"", ")", ")", "{"...
parse the outgoings form an json object and add all shape references to the current shapes, add new shapes to the shape array @param shapes @param modelJSON @param current @throws org.json.JSONException
[ "parse", "the", "outgoings", "form", "an", "json", "object", "and", "add", "all", "shape", "references", "to", "the", "current", "shapes", "add", "new", "shapes", "to", "the", "shape", "array" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L255-L271
160,811
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseChildShapes
private static void parseChildShapes(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("childShapes")) { ArrayList<Shape> childShapes = new ArrayList<Shape>(); ...
java
private static void parseChildShapes(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("childShapes")) { ArrayList<Shape> childShapes = new ArrayList<Shape>(); ...
[ "private", "static", "void", "parseChildShapes", "(", "ArrayList", "<", "Shape", ">", "shapes", ",", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"childShapes\"", ")", ")", ...
creates a shape list containing all child shapes and set it to the current shape new shape get added to the shape array @param shapes @param modelJSON @param current @throws org.json.JSONException
[ "creates", "a", "shape", "list", "containing", "all", "child", "shapes", "and", "set", "it", "to", "the", "current", "shape", "new", "shape", "get", "added", "to", "the", "shape", "array" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L281-L300
160,812
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseDockers
private static void parseDockers(JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("dockers")) { ArrayList<Point> dockers = new ArrayList<Point>(); JSONArray dockersObject = modelJSON.getJSONArray("dockers"); f...
java
private static void parseDockers(JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("dockers")) { ArrayList<Point> dockers = new ArrayList<Point>(); JSONArray dockersObject = modelJSON.getJSONArray("dockers"); f...
[ "private", "static", "void", "parseDockers", "(", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"dockers\"", ")", ")", "{", "ArrayList", "<", "Point", ">", "dockers", "=", ...
creates a point array of all dockers and add it to the current shape @param modelJSON @param current @throws org.json.JSONException
[ "creates", "a", "point", "array", "of", "all", "dockers", "and", "add", "it", "to", "the", "current", "shape" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L308-L324
160,813
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseBounds
private static void parseBounds(JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("bounds")) { JSONObject boundsObject = modelJSON.getJSONObject("bounds"); current.setBounds(new Bounds(new Point(boundsObject.getJSONObject("l...
java
private static void parseBounds(JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("bounds")) { JSONObject boundsObject = modelJSON.getJSONObject("bounds"); current.setBounds(new Bounds(new Point(boundsObject.getJSONObject("l...
[ "private", "static", "void", "parseBounds", "(", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"bounds\"", ")", ")", "{", "JSONObject", "boundsObject", "=", "modelJSON", ".",...
creates a bounds object with both point parsed from the json and set it to the current shape @param modelJSON @param current @throws org.json.JSONException
[ "creates", "a", "bounds", "object", "with", "both", "point", "parsed", "from", "the", "json", "and", "set", "it", "to", "the", "current", "shape" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L333-L343
160,814
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.parseTarget
private static void parseTarget(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("target")) { JSONObject targetObject = modelJSON.getJSONObject("target"); if (tar...
java
private static void parseTarget(ArrayList<Shape> shapes, JSONObject modelJSON, Shape current) throws JSONException { if (modelJSON.has("target")) { JSONObject targetObject = modelJSON.getJSONObject("target"); if (tar...
[ "private", "static", "void", "parseTarget", "(", "ArrayList", "<", "Shape", ">", "shapes", ",", "JSONObject", "modelJSON", ",", "Shape", "current", ")", "throws", "JSONException", "{", "if", "(", "modelJSON", ".", "has", "(", "\"target\"", ")", ")", "{", "...
parse the target resource and add it to the current shape @param shapes @param modelJSON @param current @throws org.json.JSONException
[ "parse", "the", "target", "resource", "and", "add", "it", "to", "the", "current", "shape" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L352-L362
160,815
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java
DiagramBuilder.flatRessources
public static HashMap<String, JSONObject> flatRessources(JSONObject object) throws JSONException { HashMap<String, JSONObject> result = new HashMap<String, JSONObject>(); // no cycle in hierarchies!! if (object.has("resourceId") && object.has("childShapes")) { result.put(object.getS...
java
public static HashMap<String, JSONObject> flatRessources(JSONObject object) throws JSONException { HashMap<String, JSONObject> result = new HashMap<String, JSONObject>(); // no cycle in hierarchies!! if (object.has("resourceId") && object.has("childShapes")) { result.put(object.getS...
[ "public", "static", "HashMap", "<", "String", ",", "JSONObject", ">", "flatRessources", "(", "JSONObject", "object", ")", "throws", "JSONException", "{", "HashMap", "<", "String", ",", "JSONObject", ">", "result", "=", "new", "HashMap", "<", "String", ",", "...
Prepare a model JSON for analyze, resolves the hierarchical structure creates a HashMap which contains all resourceIds as keys and for each key the JSONObject, all id are keys of this map @param object @return a HashMap keys: all ressourceIds values: all child JSONObjects @throws org.json.JSONException
[ "Prepare", "a", "model", "JSON", "for", "analyze", "resolves", "the", "hierarchical", "structure", "creates", "a", "HashMap", "which", "contains", "all", "resourceIds", "as", "keys", "and", "for", "each", "key", "the", "JSONObject", "all", "id", "are", "keys",...
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/DiagramBuilder.java#L388-L403
160,816
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java
DataIOEditorNameTextBox.setInvalidValues
public void setInvalidValues(final Set<String> invalidValues, final boolean isCaseSensitive, final String invalidValueErrorMessage) { if (isCaseSensitive) { this.invalidValues = invalidValues; } else { this.invalid...
java
public void setInvalidValues(final Set<String> invalidValues, final boolean isCaseSensitive, final String invalidValueErrorMessage) { if (isCaseSensitive) { this.invalidValues = invalidValues; } else { this.invalid...
[ "public", "void", "setInvalidValues", "(", "final", "Set", "<", "String", ">", "invalidValues", ",", "final", "boolean", "isCaseSensitive", ",", "final", "String", "invalidValueErrorMessage", ")", "{", "if", "(", "isCaseSensitive", ")", "{", "this", ".", "invali...
Sets the invalid values for the TextBox @param invalidValues @param isCaseSensitive @param invalidValueErrorMessage
[ "Sets", "the", "invalid", "values", "for", "the", "TextBox" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java#L47-L60
160,817
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java
DataIOEditorNameTextBox.setRegExp
public void setRegExp(final String pattern, final String invalidCharactersInNameErrorMessage, final String invalidCharacterTypedMessage) { regExp = RegExp.compile(pattern); this.invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage;...
java
public void setRegExp(final String pattern, final String invalidCharactersInNameErrorMessage, final String invalidCharacterTypedMessage) { regExp = RegExp.compile(pattern); this.invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage;...
[ "public", "void", "setRegExp", "(", "final", "String", "pattern", ",", "final", "String", "invalidCharactersInNameErrorMessage", ",", "final", "String", "invalidCharacterTypedMessage", ")", "{", "regExp", "=", "RegExp", ".", "compile", "(", "pattern", ")", ";", "t...
Sets the RegExp pattern for the TextBox @param pattern @param invalidCharactersInNameErrorMessage
[ "Sets", "the", "RegExp", "pattern", "for", "the", "TextBox" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/util/DataIOEditorNameTextBox.java#L67-L73
160,818
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java
Shape.getProperties
public HashMap<String, String> getProperties() { if (this.properties == null) { this.properties = new HashMap<String, String>(); } return properties; }
java
public HashMap<String, String> getProperties() { if (this.properties == null) { this.properties = new HashMap<String, String>(); } return properties; }
[ "public", "HashMap", "<", "String", ",", "String", ">", "getProperties", "(", ")", "{", "if", "(", "this", ".", "properties", "==", "null", ")", "{", "this", ".", "properties", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", ...
return a HashMap with all properties, name as key, value as value @return the properties
[ "return", "a", "HashMap", "with", "all", "properties", "name", "as", "key", "value", "as", "value" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java#L153-L158
160,819
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java
Shape.putProperty
public String putProperty(String key, String value) { return this.getProperties().put(key, value); }
java
public String putProperty(String key, String value) { return this.getProperties().put(key, value); }
[ "public", "String", "putProperty", "(", "String", "key", ",", "String", "value", ")", "{", "return", "this", ".", "getProperties", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
changes an existing property with the same name, or adds a new one @param key property name with which the specified value is to be associated @param value value to be associated with the specified property name @return the previous value associated with property name, or null if there was no mapping for property name....
[ "changes", "an", "existing", "property", "with", "the", "same", "name", "or", "adds", "a", "new", "one" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Shape.java#L177-L181
160,820
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/CalledElementServlet.java
CalledElementServlet.getRuleFlowNames
List<String> getRuleFlowNames(HttpServletRequest req) { final String[] projectAndBranch = getProjectAndBranchNames(req); // Query RuleFlowGroups for asset project and branch List<RefactoringPageRow> results = queryService.query( DesignerFindRuleFlowNamesQuery.NAME, ...
java
List<String> getRuleFlowNames(HttpServletRequest req) { final String[] projectAndBranch = getProjectAndBranchNames(req); // Query RuleFlowGroups for asset project and branch List<RefactoringPageRow> results = queryService.query( DesignerFindRuleFlowNamesQuery.NAME, ...
[ "List", "<", "String", ">", "getRuleFlowNames", "(", "HttpServletRequest", "req", ")", "{", "final", "String", "[", "]", "projectAndBranch", "=", "getProjectAndBranchNames", "(", "req", ")", ";", "// Query RuleFlowGroups for asset project and branch", "List", "<", "Re...
package scope in order to test the method
[ "package", "scope", "in", "order", "to", "test", "the", "method" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/CalledElementServlet.java#L206-L249
160,821
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/plugin/impl/PluginServiceImpl.java
PluginServiceImpl.getLocalPluginsRegistry
public static Map<String, IDiagramPlugin> getLocalPluginsRegistry(ServletContext context) { if (LOCAL == null) { LOCAL = initializeLocalPlugins(context); } return LOCAL; }
java
public static Map<String, IDiagramPlugin> getLocalPluginsRegistry(ServletContext context) { if (LOCAL == null) { LOCAL = initializeLocalPlugins(context); } return LOCAL; }
[ "public", "static", "Map", "<", "String", ",", "IDiagramPlugin", ">", "getLocalPluginsRegistry", "(", "ServletContext", "context", ")", "{", "if", "(", "LOCAL", "==", "null", ")", "{", "LOCAL", "=", "initializeLocalPlugins", "(", "context", ")", ";", "}", "r...
Initialize the local plugins registry @param context the servlet context necessary to grab the files inside the servlet. @return the set of local plugins organized by name
[ "Initialize", "the", "local", "plugins", "registry" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/plugin/impl/PluginServiceImpl.java#L81-L87
160,822
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Diagram.java
Diagram.addSsextension
public boolean addSsextension(String ssExt) { if (this.ssextensions == null) { this.ssextensions = new ArrayList<String>(); } return this.ssextensions.add(ssExt); }
java
public boolean addSsextension(String ssExt) { if (this.ssextensions == null) { this.ssextensions = new ArrayList<String>(); } return this.ssextensions.add(ssExt); }
[ "public", "boolean", "addSsextension", "(", "String", "ssExt", ")", "{", "if", "(", "this", ".", "ssextensions", "==", "null", ")", "{", "this", ".", "ssextensions", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "}", "return", "this", "."...
Add an additional SSExtension @param ssExt the ssextension to set
[ "Add", "an", "additional", "SSExtension" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/Diagram.java#L101-L106
160,823
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseStencil
private static JSONObject parseStencil(String stencilId) throws JSONException { JSONObject stencilObject = new JSONObject(); stencilObject.put("id", stencilId.toString()); return stencilObject; }
java
private static JSONObject parseStencil(String stencilId) throws JSONException { JSONObject stencilObject = new JSONObject(); stencilObject.put("id", stencilId.toString()); return stencilObject; }
[ "private", "static", "JSONObject", "parseStencil", "(", "String", "stencilId", ")", "throws", "JSONException", "{", "JSONObject", "stencilObject", "=", "new", "JSONObject", "(", ")", ";", "stencilObject", ".", "put", "(", "\"id\"", ",", "stencilId", ".", "toStri...
Delivers the correct JSON Object for the stencilId @param stencilId @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "stencilId" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L66-L73
160,824
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseChildShapesRecursive
private static JSONArray parseChildShapesRecursive(ArrayList<Shape> childShapes) throws JSONException { if (childShapes != null) { JSONArray childShapesArray = new JSONArray(); for (Shape childShape : childShapes) { JSONObject childShapeObject = new JSONObject(); ...
java
private static JSONArray parseChildShapesRecursive(ArrayList<Shape> childShapes) throws JSONException { if (childShapes != null) { JSONArray childShapesArray = new JSONArray(); for (Shape childShape : childShapes) { JSONObject childShapeObject = new JSONObject(); ...
[ "private", "static", "JSONArray", "parseChildShapesRecursive", "(", "ArrayList", "<", "Shape", ">", "childShapes", ")", "throws", "JSONException", "{", "if", "(", "childShapes", "!=", "null", ")", "{", "JSONArray", "childShapesArray", "=", "new", "JSONArray", "(",...
Parses all child Shapes recursively and adds them to the correct JSON Object @param childShapes @throws org.json.JSONException
[ "Parses", "all", "child", "Shapes", "recursively", "and", "adds", "them", "to", "the", "correct", "JSON", "Object" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L82-L116
160,825
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseTarget
private static JSONObject parseTarget(Shape target) throws JSONException { JSONObject targetObject = new JSONObject(); targetObject.put("resourceId", target.getResourceId().toString()); return targetObject; }
java
private static JSONObject parseTarget(Shape target) throws JSONException { JSONObject targetObject = new JSONObject(); targetObject.put("resourceId", target.getResourceId().toString()); return targetObject; }
[ "private", "static", "JSONObject", "parseTarget", "(", "Shape", "target", ")", "throws", "JSONException", "{", "JSONObject", "targetObject", "=", "new", "JSONObject", "(", ")", ";", "targetObject", ".", "put", "(", "\"resourceId\"", ",", "target", ".", "getResou...
Delivers the correct JSON Object for the target @param target @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "target" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L124-L131
160,826
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseDockers
private static JSONArray parseDockers(ArrayList<Point> dockers) throws JSONException { if (dockers != null) { JSONArray dockersArray = new JSONArray(); for (Point docker : dockers) { JSONObject dockerObject = new JSONObject(); dockerObject.put("x", ...
java
private static JSONArray parseDockers(ArrayList<Point> dockers) throws JSONException { if (dockers != null) { JSONArray dockersArray = new JSONArray(); for (Point docker : dockers) { JSONObject dockerObject = new JSONObject(); dockerObject.put("x", ...
[ "private", "static", "JSONArray", "parseDockers", "(", "ArrayList", "<", "Point", ">", "dockers", ")", "throws", "JSONException", "{", "if", "(", "dockers", "!=", "null", ")", "{", "JSONArray", "dockersArray", "=", "new", "JSONArray", "(", ")", ";", "for", ...
Delivers the correct JSON Object for the dockers @param dockers @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "dockers" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L139-L158
160,827
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseOutgoings
private static JSONArray parseOutgoings(ArrayList<Shape> outgoings) throws JSONException { if (outgoings != null) { JSONArray outgoingsArray = new JSONArray(); for (Shape outgoing : outgoings) { JSONObject outgoingObject = new JSONObject(); outgoingObjec...
java
private static JSONArray parseOutgoings(ArrayList<Shape> outgoings) throws JSONException { if (outgoings != null) { JSONArray outgoingsArray = new JSONArray(); for (Shape outgoing : outgoings) { JSONObject outgoingObject = new JSONObject(); outgoingObjec...
[ "private", "static", "JSONArray", "parseOutgoings", "(", "ArrayList", "<", "Shape", ">", "outgoings", ")", "throws", "JSONException", "{", "if", "(", "outgoings", "!=", "null", ")", "{", "JSONArray", "outgoingsArray", "=", "new", "JSONArray", "(", ")", ";", ...
Delivers the correct JSON Object for outgoings @param outgoings @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "outgoings" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L166-L182
160,828
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseProperties
private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException { if (properties != null) { JSONObject propertiesObject = new JSONObject(); for (String key : properties.keySet()) { String propertyValue = properties.get(key); ...
java
private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException { if (properties != null) { JSONObject propertiesObject = new JSONObject(); for (String key : properties.keySet()) { String propertyValue = properties.get(key); ...
[ "private", "static", "JSONObject", "parseProperties", "(", "HashMap", "<", "String", ",", "String", ">", "properties", ")", "throws", "JSONException", "{", "if", "(", "properties", "!=", "null", ")", "{", "JSONObject", "propertiesObject", "=", "new", "JSONObject...
Delivers the correct JSON Object for properties @param properties @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "properties" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L190-L222
160,829
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseStencilSetExtensions
private static JSONArray parseStencilSetExtensions(ArrayList<String> extensions) { if (extensions != null) { JSONArray extensionsArray = new JSONArray(); for (String extension : extensions) { extensionsArray.put(extension.toString()); } return ex...
java
private static JSONArray parseStencilSetExtensions(ArrayList<String> extensions) { if (extensions != null) { JSONArray extensionsArray = new JSONArray(); for (String extension : extensions) { extensionsArray.put(extension.toString()); } return ex...
[ "private", "static", "JSONArray", "parseStencilSetExtensions", "(", "ArrayList", "<", "String", ">", "extensions", ")", "{", "if", "(", "extensions", "!=", "null", ")", "{", "JSONArray", "extensionsArray", "=", "new", "JSONArray", "(", ")", ";", "for", "(", ...
Delivers the correct JSON Object for the Stencilset Extensions @param extensions
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "Stencilset", "Extensions" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L229-L241
160,830
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseStencilSet
private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException { if (stencilSet != null) { JSONObject stencilSetObject = new JSONObject(); stencilSetObject.put("url", stencilSet.getUrl().toString()); stencilSetObject.pu...
java
private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException { if (stencilSet != null) { JSONObject stencilSetObject = new JSONObject(); stencilSetObject.put("url", stencilSet.getUrl().toString()); stencilSetObject.pu...
[ "private", "static", "JSONObject", "parseStencilSet", "(", "StencilSet", "stencilSet", ")", "throws", "JSONException", "{", "if", "(", "stencilSet", "!=", "null", ")", "{", "JSONObject", "stencilSetObject", "=", "new", "JSONObject", "(", ")", ";", "stencilSetObjec...
Delivers the correct JSON Object for the Stencilset @param stencilSet @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "Stencilset" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L249-L262
160,831
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java
JSONBuilder.parseBounds
private static JSONObject parseBounds(Bounds bounds) throws JSONException { if (bounds != null) { JSONObject boundsObject = new JSONObject(); JSONObject lowerRight = new JSONObject(); JSONObject upperLeft = new JSONObject(); lowerRight.put("x", ...
java
private static JSONObject parseBounds(Bounds bounds) throws JSONException { if (bounds != null) { JSONObject boundsObject = new JSONObject(); JSONObject lowerRight = new JSONObject(); JSONObject upperLeft = new JSONObject(); lowerRight.put("x", ...
[ "private", "static", "JSONObject", "parseBounds", "(", "Bounds", "bounds", ")", "throws", "JSONException", "{", "if", "(", "bounds", "!=", "null", ")", "{", "JSONObject", "boundsObject", "=", "new", "JSONObject", "(", ")", ";", "JSONObject", "lowerRight", "=",...
Delivers the correct JSON Object for the Bounds @param bounds @throws org.json.JSONException
[ "Delivers", "the", "correct", "JSON", "Object", "for", "the", "Bounds" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L270-L295
160,832
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java
StringUtils.createQuotedConstant
public static String createQuotedConstant(String str) { if (str == null || str.isEmpty()) { return str; } try { Double.parseDouble(str); } catch (NumberFormatException nfe) { return "\"" + str + "\""; } return str; }
java
public static String createQuotedConstant(String str) { if (str == null || str.isEmpty()) { return str; } try { Double.parseDouble(str); } catch (NumberFormatException nfe) { return "\"" + str + "\""; } return str; }
[ "public", "static", "String", "createQuotedConstant", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", "||", "str", ".", "isEmpty", "(", ")", ")", "{", "return", "str", ";", "}", "try", "{", "Double", ".", "parseDouble", "(", "str", ")...
Puts strings inside quotes and numerics are left as they are. @param str @return
[ "Puts", "strings", "inside", "quotes", "and", "numerics", "are", "left", "as", "they", "are", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L31-L41
160,833
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java
StringUtils.createUnquotedConstant
public static String createUnquotedConstant(String str) { if (str == null || str.isEmpty()) { return str; } if (str.startsWith("\"")) { str = str.substring(1); } if (str.endsWith("\"")) { str = str.substring(0, s...
java
public static String createUnquotedConstant(String str) { if (str == null || str.isEmpty()) { return str; } if (str.startsWith("\"")) { str = str.substring(1); } if (str.endsWith("\"")) { str = str.substring(0, s...
[ "public", "static", "String", "createUnquotedConstant", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", "||", "str", ".", "isEmpty", "(", ")", ")", "{", "return", "str", ";", "}", "if", "(", "str", ".", "startsWith", "(", "\"\\\"\"", ...
Removes double-quotes from around a string @param str @return
[ "Removes", "double", "-", "quotes", "from", "around", "a", "string" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L48-L60
160,834
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java
StringUtils.isQuotedConstant
public static boolean isQuotedConstant(String str) { if (str == null || str.isEmpty()) { return false; } return (str.startsWith("\"") && str.endsWith("\"")); }
java
public static boolean isQuotedConstant(String str) { if (str == null || str.isEmpty()) { return false; } return (str.startsWith("\"") && str.endsWith("\"")); }
[ "public", "static", "boolean", "isQuotedConstant", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", "||", "str", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "return", "(", "str", ".", "startsWith", "(", "\"\\\"\"", ...
Returns true if string starts and ends with double-quote @param str @return
[ "Returns", "true", "if", "string", "starts", "and", "ends", "with", "double", "-", "quote" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L67-L72
160,835
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java
StringUtils.urlEncode
public String urlEncode(String s) { if (s == null || s.isEmpty()) { return s; } return URL.encodeQueryString(s); }
java
public String urlEncode(String s) { if (s == null || s.isEmpty()) { return s; } return URL.encodeQueryString(s); }
[ "public", "String", "urlEncode", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", "||", "s", ".", "isEmpty", "(", ")", ")", "{", "return", "s", ";", "}", "return", "URL", ".", "encodeQueryString", "(", "s", ")", ";", "}" ]
URLEncode a string @param s @return
[ "URLEncode", "a", "string" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L79-L85
160,836
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java
StringUtils.urlDecode
public String urlDecode(String s) { if (s == null || s.isEmpty()) { return s; } return URL.decodeQueryString(s); }
java
public String urlDecode(String s) { if (s == null || s.isEmpty()) { return s; } return URL.decodeQueryString(s); }
[ "public", "String", "urlDecode", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", "||", "s", ".", "isEmpty", "(", ")", ")", "{", "return", "s", ";", "}", "return", "URL", ".", "decodeQueryString", "(", "s", ")", ";", "}" ]
URLDecode a string @param s @return
[ "URLDecode", "a", "string" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/util/StringUtils.java#L92-L97
160,837
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java
Bpmn2JsonUnmarshaller.unmarshall
private Bpmn2Resource unmarshall(JsonParser parser, String preProcessingData) throws IOException { try { parser.nextToken(); // open the object ResourceSet rSet = new ResourceSetImpl(); rSet.getResourceFactoryRegistry().getExtensionToFacto...
java
private Bpmn2Resource unmarshall(JsonParser parser, String preProcessingData) throws IOException { try { parser.nextToken(); // open the object ResourceSet rSet = new ResourceSetImpl(); rSet.getResourceFactoryRegistry().getExtensionToFacto...
[ "private", "Bpmn2Resource", "unmarshall", "(", "JsonParser", "parser", ",", "String", "preProcessingData", ")", "throws", "IOException", "{", "try", "{", "parser", ".", "nextToken", "(", ")", ";", "// open the object", "ResourceSet", "rSet", "=", "new", "ResourceS...
Start unmarshalling using the parser. @param parser @param preProcessingData @return the root element of a bpmn2 document. @throws java.io.IOException
[ "Start", "unmarshalling", "using", "the", "parser", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L274-L338
160,838
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java
Bpmn2JsonUnmarshaller.revisitThrowEvents
public void revisitThrowEvents(Definitions def) { List<RootElement> rootElements = def.getRootElements(); List<Signal> toAddSignals = new ArrayList<Signal>(); Set<Error> toAddErrors = new HashSet<Error>(); Set<Escalation> toAddEscalations = new HashSet<Escalation>(); Set<Message>...
java
public void revisitThrowEvents(Definitions def) { List<RootElement> rootElements = def.getRootElements(); List<Signal> toAddSignals = new ArrayList<Signal>(); Set<Error> toAddErrors = new HashSet<Error>(); Set<Escalation> toAddEscalations = new HashSet<Escalation>(); Set<Message>...
[ "public", "void", "revisitThrowEvents", "(", "Definitions", "def", ")", "{", "List", "<", "RootElement", ">", "rootElements", "=", "def", ".", "getRootElements", "(", ")", ";", "List", "<", "Signal", ">", "toAddSignals", "=", "new", "ArrayList", "<", "Signal...
Updates event definitions for all throwing events. @param def Definitions
[ "Updates", "event", "definitions", "for", "all", "throwing", "events", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L1704-L1748
160,839
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java
Bpmn2JsonUnmarshaller.revisitGateways
private void revisitGateways(Definitions def) { List<RootElement> rootElements = def.getRootElements(); for (RootElement root : rootElements) { if (root instanceof Process) { setGatewayInfo((Process) root); } } }
java
private void revisitGateways(Definitions def) { List<RootElement> rootElements = def.getRootElements(); for (RootElement root : rootElements) { if (root instanceof Process) { setGatewayInfo((Process) root); } } }
[ "private", "void", "revisitGateways", "(", "Definitions", "def", ")", "{", "List", "<", "RootElement", ">", "rootElements", "=", "def", ".", "getRootElements", "(", ")", ";", "for", "(", "RootElement", "root", ":", "rootElements", ")", "{", "if", "(", "roo...
Updates the gatewayDirection attributes of all gateways. @param def
[ "Updates", "the", "gatewayDirection", "attributes", "of", "all", "gateways", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L2613-L2620
160,840
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java
Bpmn2JsonUnmarshaller.revisitMessages
private void revisitMessages(Definitions def) { List<RootElement> rootElements = def.getRootElements(); List<ItemDefinition> toAddDefinitions = new ArrayList<ItemDefinition>(); for (RootElement root : rootElements) { if (root instanceof Message) { if (!existsMessageIt...
java
private void revisitMessages(Definitions def) { List<RootElement> rootElements = def.getRootElements(); List<ItemDefinition> toAddDefinitions = new ArrayList<ItemDefinition>(); for (RootElement root : rootElements) { if (root instanceof Message) { if (!existsMessageIt...
[ "private", "void", "revisitMessages", "(", "Definitions", "def", ")", "{", "List", "<", "RootElement", ">", "rootElements", "=", "def", ".", "getRootElements", "(", ")", ";", "List", "<", "ItemDefinition", ">", "toAddDefinitions", "=", "new", "ArrayList", "<",...
Revisit message to set their item ref to a item definition @param def Definitions
[ "Revisit", "message", "to", "set", "their", "item", "ref", "to", "a", "item", "definition" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L3032-L3049
160,841
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java
Bpmn2JsonUnmarshaller.reconnectFlows
private void reconnectFlows() { // create the reverse id map: for (Entry<Object, List<String>> entry : _outgoingFlows.entrySet()) { for (String flowId : entry.getValue()) { if (entry.getKey() instanceof SequenceFlow) { // if it is a sequence flow, we can tell its targets ...
java
private void reconnectFlows() { // create the reverse id map: for (Entry<Object, List<String>> entry : _outgoingFlows.entrySet()) { for (String flowId : entry.getValue()) { if (entry.getKey() instanceof SequenceFlow) { // if it is a sequence flow, we can tell its targets ...
[ "private", "void", "reconnectFlows", "(", ")", "{", "// create the reverse id map:", "for", "(", "Entry", "<", "Object", ",", "List", "<", "String", ">", ">", "entry", ":", "_outgoingFlows", ".", "entrySet", "(", ")", ")", "{", "for", "(", "String", "flowI...
Reconnect the sequence flows and the flow nodes. Done after the initial pass so that we have all the target information.
[ "Reconnect", "the", "sequence", "flows", "and", "the", "flow", "nodes", ".", "Done", "after", "the", "initial", "pass", "so", "that", "we", "have", "all", "the", "target", "information", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/bpmn2/impl/Bpmn2JsonUnmarshaller.java#L3076-L3098
160,842
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java
AbstractConnectorServlet.parseRequest
protected void parseRequest(HttpServletRequest request, HttpServletResponse response) { requestParams = new HashMap<String, Object>(); listFiles = new ArrayList<FileItemStream>(); listFileStreams = new ArrayList<ByteArrayOutputStream>(); // Parse the requ...
java
protected void parseRequest(HttpServletRequest request, HttpServletResponse response) { requestParams = new HashMap<String, Object>(); listFiles = new ArrayList<FileItemStream>(); listFileStreams = new ArrayList<ByteArrayOutputStream>(); // Parse the requ...
[ "protected", "void", "parseRequest", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "requestParams", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "listFiles", "=", "new", "ArrayList", "<", "F...
Parse request parameters and files. @param request @param response
[ "Parse", "request", "parameters", "and", "files", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java#L295-L352
160,843
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java
AbstractConnectorServlet.putResponse
protected void putResponse(JSONObject json, String param, Object value) { try { json.put(param, value); } catch (JSONException e) { logger.error("json write error", e); ...
java
protected void putResponse(JSONObject json, String param, Object value) { try { json.put(param, value); } catch (JSONException e) { logger.error("json write error", e); ...
[ "protected", "void", "putResponse", "(", "JSONObject", "json", ",", "String", "param", ",", "Object", "value", ")", "{", "try", "{", "json", ".", "put", "(", "param", ",", "value", ")", ";", "}", "catch", "(", "JSONException", "e", ")", "{", "logger", ...
Append data to JSON response. @param param @param value
[ "Append", "data", "to", "JSON", "response", "." ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/menu/connector/AbstractConnectorServlet.java#L359-L369
160,844
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java
Variable.deserialize
public static Variable deserialize(String s, VariableType variableType, List<String> dataTypes) { Variable var = new Variable(variableType); String[] varParts = s.split(":"); if (varParts.length > 0) { Stri...
java
public static Variable deserialize(String s, VariableType variableType, List<String> dataTypes) { Variable var = new Variable(variableType); String[] varParts = s.split(":"); if (varParts.length > 0) { Stri...
[ "public", "static", "Variable", "deserialize", "(", "String", "s", ",", "VariableType", "variableType", ",", "List", "<", "String", ">", "dataTypes", ")", "{", "Variable", "var", "=", "new", "Variable", "(", "variableType", ")", ";", "String", "[", "]", "v...
Deserializes a variable, checking whether the datatype is custom or not @param s @param variableType @param dataTypes @return
[ "Deserializes", "a", "variable", "checking", "whether", "the", "datatype", "is", "custom", "or", "not" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java#L109-L131
160,845
kiegroup/jbpm-designer
jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java
Variable.deserialize
public static Variable deserialize(String s, VariableType variableType) { return deserialize(s, variableType, null); }
java
public static Variable deserialize(String s, VariableType variableType) { return deserialize(s, variableType, null); }
[ "public", "static", "Variable", "deserialize", "(", "String", "s", ",", "VariableType", "variableType", ")", "{", "return", "deserialize", "(", "s", ",", "variableType", ",", "null", ")", ";", "}" ]
Deserializes a variable, NOT checking whether the datatype is custom @param s @param variableType @return
[ "Deserializes", "a", "variable", "NOT", "checking", "whether", "the", "datatype", "is", "custom" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-client/src/main/java/org/jbpm/designer/client/shared/Variable.java#L139-L144
160,846
kiegroup/jbpm-designer
jbpm-designer-utilities/src/main/java/org/jbpm/designer/utilities/svginline/SvgInline.java
SvgInline.processStencilSet
public void processStencilSet() throws IOException { StringBuilder stencilSetFileContents = new StringBuilder(); Scanner scanner = null; try { scanner = new Scanner(new File(ssInFile), "UTF-8"); String currentLine = ""; Strin...
java
public void processStencilSet() throws IOException { StringBuilder stencilSetFileContents = new StringBuilder(); Scanner scanner = null; try { scanner = new Scanner(new File(ssInFile), "UTF-8"); String currentLine = ""; Strin...
[ "public", "void", "processStencilSet", "(", ")", "throws", "IOException", "{", "StringBuilder", "stencilSetFileContents", "=", "new", "StringBuilder", "(", ")", ";", "Scanner", "scanner", "=", "null", ";", "try", "{", "scanner", "=", "new", "Scanner", "(", "ne...
Processes a stencilset template file @throws IOException
[ "Processes", "a", "stencilset", "template", "file" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-utilities/src/main/java/org/jbpm/designer/utilities/svginline/SvgInline.java#L77-L138
160,847
kiegroup/jbpm-designer
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/profile/impl/ProfileServiceImpl.java
ProfileServiceImpl.init
public void init(ServletContext context) { if (profiles != null) { for (IDiagramProfile profile : profiles) { profile.init(context); _registry.put(profile.getName(), profile); } } }
java
public void init(ServletContext context) { if (profiles != null) { for (IDiagramProfile profile : profiles) { profile.init(context); _registry.put(profile.getName(), profile); } } }
[ "public", "void", "init", "(", "ServletContext", "context", ")", "{", "if", "(", "profiles", "!=", "null", ")", "{", "for", "(", "IDiagramProfile", "profile", ":", "profiles", ")", "{", "profile", ".", "init", "(", "context", ")", ";", "_registry", ".", ...
Initialize the service with a context @param context the servlet context to initialize the profile.
[ "Initialize", "the", "service", "with", "a", "context" ]
97b048d06f083a1f831c971c2e9fdfd0952d2b0b
https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/web/profile/impl/ProfileServiceImpl.java#L66-L74
160,848
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.getPropertyName
public static String getPropertyName(String name) { if(name != null && (name.startsWith("get") || name.startsWith("set"))) { StringBuilder b = new StringBuilder(name); b.delete(0, 3); b.setCharAt(0, Character.toLowerCase(b.charAt(0))); return b.toString(); ...
java
public static String getPropertyName(String name) { if(name != null && (name.startsWith("get") || name.startsWith("set"))) { StringBuilder b = new StringBuilder(name); b.delete(0, 3); b.setCharAt(0, Character.toLowerCase(b.charAt(0))); return b.toString(); ...
[ "public", "static", "String", "getPropertyName", "(", "String", "name", ")", "{", "if", "(", "name", "!=", "null", "&&", "(", "name", ".", "startsWith", "(", "\"get\"", ")", "||", "name", ".", "startsWith", "(", "\"set\"", ")", ")", ")", "{", "StringBu...
Get the property name of a method name. For example the property name of setSomeValue would be someValue. Names not beginning with set or get are not changed. @param name The name to process @return The property name
[ "Get", "the", "property", "name", "of", "a", "method", "name", ".", "For", "example", "the", "property", "name", "of", "setSomeValue", "would", "be", "someValue", ".", "Names", "not", "beginning", "with", "set", "or", "get", "are", "not", "changed", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L38-L47
160,849
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.loadClass
public static Class<?> loadClass(String className) { try { return Class.forName(className); } catch(ClassNotFoundException e) { throw new IllegalArgumentException(e); } }
java
public static Class<?> loadClass(String className) { try { return Class.forName(className); } catch(ClassNotFoundException e) { throw new IllegalArgumentException(e); } }
[ "public", "static", "Class", "<", "?", ">", "loadClass", "(", "String", "className", ")", "{", "try", "{", "return", "Class", ".", "forName", "(", "className", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "throw", "new", "Illegal...
Load the given class using the default constructor @param className The name of the class @return The class object
[ "Load", "the", "given", "class", "using", "the", "default", "constructor" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L55-L61
160,850
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.loadClass
public static Class<?> loadClass(String className, ClassLoader cl) { try { return Class.forName(className, false, cl); } catch(ClassNotFoundException e) { throw new IllegalArgumentException(e); } }
java
public static Class<?> loadClass(String className, ClassLoader cl) { try { return Class.forName(className, false, cl); } catch(ClassNotFoundException e) { throw new IllegalArgumentException(e); } }
[ "public", "static", "Class", "<", "?", ">", "loadClass", "(", "String", "className", ",", "ClassLoader", "cl", ")", "{", "try", "{", "return", "Class", ".", "forName", "(", "className", ",", "false", ",", "cl", ")", ";", "}", "catch", "(", "ClassNotFou...
Load the given class using a specific class loader. @param className The name of the class @param cl The Class Loader to be used for finding the class. @return The class object
[ "Load", "the", "given", "class", "using", "a", "specific", "class", "loader", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L70-L76
160,851
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.callConstructor
public static <T> T callConstructor(Class<T> klass) { return callConstructor(klass, new Class<?>[0], new Object[0]); }
java
public static <T> T callConstructor(Class<T> klass) { return callConstructor(klass, new Class<?>[0], new Object[0]); }
[ "public", "static", "<", "T", ">", "T", "callConstructor", "(", "Class", "<", "T", ">", "klass", ")", "{", "return", "callConstructor", "(", "klass", ",", "new", "Class", "<", "?", ">", "[", "0", "]", ",", "new", "Object", "[", "0", "]", ")", ";"...
Call the no-arg constructor for the given class @param <T> The type of the thing to construct @param klass The class @return The constructed thing
[ "Call", "the", "no", "-", "arg", "constructor", "for", "the", "given", "class" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L85-L87
160,852
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.callConstructor
public static <T> T callConstructor(Class<T> klass, Object[] args) { Class<?>[] klasses = new Class[args.length]; for(int i = 0; i < args.length; i++) klasses[i] = args[i].getClass(); return callConstructor(klass, klasses, args); }
java
public static <T> T callConstructor(Class<T> klass, Object[] args) { Class<?>[] klasses = new Class[args.length]; for(int i = 0; i < args.length; i++) klasses[i] = args[i].getClass(); return callConstructor(klass, klasses, args); }
[ "public", "static", "<", "T", ">", "T", "callConstructor", "(", "Class", "<", "T", ">", "klass", ",", "Object", "[", "]", "args", ")", "{", "Class", "<", "?", ">", "[", "]", "klasses", "=", "new", "Class", "[", "args", ".", "length", "]", ";", ...
Call the constructor for the given class, inferring the correct types for the arguments. This could be confusing if there are multiple constructors with the same number of arguments and the values themselves don't disambiguate. @param klass The class to construct @param args The arguments @return The constructed value
[ "Call", "the", "constructor", "for", "the", "given", "class", "inferring", "the", "correct", "types", "for", "the", "arguments", ".", "This", "could", "be", "confusing", "if", "there", "are", "multiple", "constructors", "with", "the", "same", "number", "of", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L99-L104
160,853
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.callMethod
public static <T> Object callMethod(Object obj, Class<T> c, String name, Class<?>[] classes, Object[] args) { try { Method m = getMethod(c, ...
java
public static <T> Object callMethod(Object obj, Class<T> c, String name, Class<?>[] classes, Object[] args) { try { Method m = getMethod(c, ...
[ "public", "static", "<", "T", ">", "Object", "callMethod", "(", "Object", "obj", ",", "Class", "<", "T", ">", "c", ",", "String", "name", ",", "Class", "<", "?", ">", "[", "]", "classes", ",", "Object", "[", "]", "args", ")", "{", "try", "{", "...
Call the named method @param obj The object to call the method on @param c The class of the object @param name The name of the method @param args The method arguments @return The result of the method
[ "Call", "the", "named", "method" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L137-L150
160,854
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.getMethod
public static <T> Method getMethod(Class<T> c, String name, Class<?>... argTypes) { try { return c.getMethod(name, argTypes); } catch(NoSuchMethodException e) { throw new IllegalArgumentException(e); } }
java
public static <T> Method getMethod(Class<T> c, String name, Class<?>... argTypes) { try { return c.getMethod(name, argTypes); } catch(NoSuchMethodException e) { throw new IllegalArgumentException(e); } }
[ "public", "static", "<", "T", ">", "Method", "getMethod", "(", "Class", "<", "T", ">", "c", ",", "String", "name", ",", "Class", "<", "?", ">", "...", "argTypes", ")", "{", "try", "{", "return", "c", ".", "getMethod", "(", "name", ",", "argTypes", ...
Get the named method from the class @param c The class to get the method from @param name The method name @param argTypes The argument types @return The method
[ "Get", "the", "named", "method", "from", "the", "class" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L160-L166
160,855
voldemort/voldemort
src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java
VersionedPutPruneJob.pruneNonReplicaEntries
public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals, List<Integer> keyReplicas, MutableBoolean didPrune) { List<Versioned<byte[]>> prunedVals = ...
java
public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals, List<Integer> keyReplicas, MutableBoolean didPrune) { List<Versioned<byte[]>> prunedVals = ...
[ "public", "static", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "pruneNonReplicaEntries", "(", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "vals", ",", "List", "<", "Integer", ">", "keyReplicas", ",", "MutableBoolean", "didP...
Remove all non replica clock entries from the list of versioned values provided @param vals list of versioned values to prune replicas from @param keyReplicas list of current replicas for the given key @param didPrune flag to mark if we did actually prune something @return pruned list
[ "Remove", "all", "non", "replica", "clock", "entries", "from", "the", "list", "of", "versioned", "values", "provided" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java#L181-L199
160,856
voldemort/voldemort
src/java/voldemort/serialization/ObjectSerializer.java
ObjectSerializer.toBytes
public byte[] toBytes(T object) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(stream); out.writeObject(object); return stream.toByteArray(); } catch(IOException e) { throw ne...
java
public byte[] toBytes(T object) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(stream); out.writeObject(object); return stream.toByteArray(); } catch(IOException e) { throw ne...
[ "public", "byte", "[", "]", "toBytes", "(", "T", "object", ")", "{", "try", "{", "ByteArrayOutputStream", "stream", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "ObjectOutputStream", "out", "=", "new", "ObjectOutputStream", "(", "stream", ")", ";", "o...
Transform the given object into an array of bytes @param object The object to be serialized @return The bytes created from serializing the object
[ "Transform", "the", "given", "object", "into", "an", "array", "of", "bytes" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/ObjectSerializer.java#L40-L49
160,857
voldemort/voldemort
src/java/voldemort/serialization/ObjectSerializer.java
ObjectSerializer.toObject
@SuppressWarnings("unchecked") public T toObject(byte[] bytes) { try { return (T) new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject(); } catch(IOException e) { throw new SerializationException(e); } catch(ClassNotFoundException c) { throw n...
java
@SuppressWarnings("unchecked") public T toObject(byte[] bytes) { try { return (T) new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject(); } catch(IOException e) { throw new SerializationException(e); } catch(ClassNotFoundException c) { throw n...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "toObject", "(", "byte", "[", "]", "bytes", ")", "{", "try", "{", "return", "(", "T", ")", "new", "ObjectInputStream", "(", "new", "ByteArrayInputStream", "(", "bytes", ")", ")", ".", "re...
Transform the given bytes into an object. @param bytes The bytes to construct the object from @return The object constructed
[ "Transform", "the", "given", "bytes", "into", "an", "object", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/ObjectSerializer.java#L57-L66
160,858
voldemort/voldemort
src/java/voldemort/server/protocol/vold/VoldemortNativeRequestHandler.java
VoldemortNativeRequestHandler.isCompleteRequest
@Override public boolean isCompleteRequest(final ByteBuffer buffer) throws VoldemortException { DataInputStream inputStream = new DataInputStream(new ByteBufferBackedInputStream(buffer)); try { byte opCode = inputStream.readByte(); // Store Name inputStream.read...
java
@Override public boolean isCompleteRequest(final ByteBuffer buffer) throws VoldemortException { DataInputStream inputStream = new DataInputStream(new ByteBufferBackedInputStream(buffer)); try { byte opCode = inputStream.readByte(); // Store Name inputStream.read...
[ "@", "Override", "public", "boolean", "isCompleteRequest", "(", "final", "ByteBuffer", "buffer", ")", "throws", "VoldemortException", "{", "DataInputStream", "inputStream", "=", "new", "DataInputStream", "(", "new", "ByteBufferBackedInputStream", "(", "buffer", ")", "...
This is pretty ugly. We end up mimicking the request logic here, so this needs to stay in sync with handleRequest.
[ "This", "is", "pretty", "ugly", ".", "We", "end", "up", "mimicking", "the", "request", "logic", "here", "so", "this", "needs", "to", "stay", "in", "sync", "with", "handleRequest", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/vold/VoldemortNativeRequestHandler.java#L161-L216
160,859
voldemort/voldemort
src/java/voldemort/utils/WriteThroughCache.java
WriteThroughCache.put
@Override synchronized public V put(K key, V value) { V oldValue = this.get(key); try { super.put(key, value); writeBack(key, value); return oldValue; } catch(Exception e) { super.put(key, oldValue); writeBack(key, oldValue); ...
java
@Override synchronized public V put(K key, V value) { V oldValue = this.get(key); try { super.put(key, value); writeBack(key, value); return oldValue; } catch(Exception e) { super.put(key, oldValue); writeBack(key, oldValue); ...
[ "@", "Override", "synchronized", "public", "V", "put", "(", "K", "key", ",", "V", "value", ")", "{", "V", "oldValue", "=", "this", ".", "get", "(", "key", ")", ";", "try", "{", "super", ".", "put", "(", "key", ",", "value", ")", ";", "writeBack",...
Updates the value in HashMap and writeBack as Atomic step
[ "Updates", "the", "value", "in", "HashMap", "and", "writeBack", "as", "Atomic", "step" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/WriteThroughCache.java#L55-L68
160,860
voldemort/voldemort
src/java/voldemort/store/readonly/checksum/CheckSum.java
CheckSum.update
public void update(int number) { byte[] numberInBytes = new byte[ByteUtils.SIZE_OF_INT]; ByteUtils.writeInt(numberInBytes, number, 0); update(numberInBytes); }
java
public void update(int number) { byte[] numberInBytes = new byte[ByteUtils.SIZE_OF_INT]; ByteUtils.writeInt(numberInBytes, number, 0); update(numberInBytes); }
[ "public", "void", "update", "(", "int", "number", ")", "{", "byte", "[", "]", "numberInBytes", "=", "new", "byte", "[", "ByteUtils", ".", "SIZE_OF_INT", "]", ";", "ByteUtils", ".", "writeInt", "(", "numberInBytes", ",", "number", ",", "0", ")", ";", "u...
Update the underlying buffer using the integer @param number number to be stored in checksum buffer
[ "Update", "the", "underlying", "buffer", "using", "the", "integer" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/checksum/CheckSum.java#L64-L68
160,861
voldemort/voldemort
src/java/voldemort/store/readonly/checksum/CheckSum.java
CheckSum.update
public void update(short number) { byte[] numberInBytes = new byte[ByteUtils.SIZE_OF_SHORT]; ByteUtils.writeShort(numberInBytes, number, 0); update(numberInBytes); }
java
public void update(short number) { byte[] numberInBytes = new byte[ByteUtils.SIZE_OF_SHORT]; ByteUtils.writeShort(numberInBytes, number, 0); update(numberInBytes); }
[ "public", "void", "update", "(", "short", "number", ")", "{", "byte", "[", "]", "numberInBytes", "=", "new", "byte", "[", "ByteUtils", ".", "SIZE_OF_SHORT", "]", ";", "ByteUtils", ".", "writeShort", "(", "numberInBytes", ",", "number", ",", "0", ")", ";"...
Update the underlying buffer using the short @param number number to be stored in checksum buffer
[ "Update", "the", "underlying", "buffer", "using", "the", "short" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/checksum/CheckSum.java#L75-L79
160,862
voldemort/voldemort
src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java
AsyncPutSynchronizer.tryDelegateSlop
public synchronized boolean tryDelegateSlop(Node node) { if(asyncCallbackShouldSendhint) { return false; } else { slopDestinations.put(node, true); return true; } }
java
public synchronized boolean tryDelegateSlop(Node node) { if(asyncCallbackShouldSendhint) { return false; } else { slopDestinations.put(node, true); return true; } }
[ "public", "synchronized", "boolean", "tryDelegateSlop", "(", "Node", "node", ")", "{", "if", "(", "asyncCallbackShouldSendhint", ")", "{", "return", "false", ";", "}", "else", "{", "slopDestinations", ".", "put", "(", "node", ",", "true", ")", ";", "return",...
Try to delegate the responsibility of sending slops to master @param node The node that slop should eventually be pushed to @return true if master accept the responsibility; false if master does not accept
[ "Try", "to", "delegate", "the", "responsibility", "of", "sending", "slops", "to", "master" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java#L64-L71
160,863
voldemort/voldemort
src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java
AsyncPutSynchronizer.tryDelegateResponseHandling
public synchronized boolean tryDelegateResponseHandling(Response<ByteArray, Object> response) { if(responseHandlingCutoff) { return false; } else { responseQueue.offer(response); this.notifyAll(); return true; } }
java
public synchronized boolean tryDelegateResponseHandling(Response<ByteArray, Object> response) { if(responseHandlingCutoff) { return false; } else { responseQueue.offer(response); this.notifyAll(); return true; } }
[ "public", "synchronized", "boolean", "tryDelegateResponseHandling", "(", "Response", "<", "ByteArray", ",", "Object", ">", "response", ")", "{", "if", "(", "responseHandlingCutoff", ")", "{", "return", "false", ";", "}", "else", "{", "responseQueue", ".", "offer...
try to delegate the master to handle the response @param response @return true if the master accepted the response; false if the master didn't accept
[ "try", "to", "delegate", "the", "master", "to", "handle", "the", "response" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java#L87-L95
160,864
voldemort/voldemort
src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java
AsyncPutSynchronizer.responseQueuePoll
public synchronized Response<ByteArray, Object> responseQueuePoll(long timeout, TimeUnit timeUnit) throws InterruptedException { long timeoutMs = timeUnit.toMillis(timeout); long timeoutWallClockMs = System.currentTimeMill...
java
public synchronized Response<ByteArray, Object> responseQueuePoll(long timeout, TimeUnit timeUnit) throws InterruptedException { long timeoutMs = timeUnit.toMillis(timeout); long timeoutWallClockMs = System.currentTimeMill...
[ "public", "synchronized", "Response", "<", "ByteArray", ",", "Object", ">", "responseQueuePoll", "(", "long", "timeout", ",", "TimeUnit", "timeUnit", ")", "throws", "InterruptedException", "{", "long", "timeoutMs", "=", "timeUnit", ".", "toMillis", "(", "timeout",...
poll the response queue for response @param timeout timeout amount @param timeUnit timeUnit of timeout @return same result of BlockQueue.poll(long, TimeUnit) @throws InterruptedException
[ "poll", "the", "response", "queue", "for", "response" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java#L105-L121
160,865
voldemort/voldemort
contrib/restclient/src/java/voldemort/restclient/RESTClientConfig.java
RESTClientConfig.setProperties
private void setProperties(Properties properties) { Props props = new Props(properties); if(props.containsKey(ClientConfig.ENABLE_JMX_PROPERTY)) { this.setEnableJmx(props.getBoolean(ClientConfig.ENABLE_JMX_PROPERTY)); } if(props.containsKey(ClientConfig.BOOTSTRAP_URLS_PROPER...
java
private void setProperties(Properties properties) { Props props = new Props(properties); if(props.containsKey(ClientConfig.ENABLE_JMX_PROPERTY)) { this.setEnableJmx(props.getBoolean(ClientConfig.ENABLE_JMX_PROPERTY)); } if(props.containsKey(ClientConfig.BOOTSTRAP_URLS_PROPER...
[ "private", "void", "setProperties", "(", "Properties", "properties", ")", "{", "Props", "props", "=", "new", "Props", "(", "properties", ")", ";", "if", "(", "props", ".", "containsKey", "(", "ClientConfig", ".", "ENABLE_JMX_PROPERTY", ")", ")", "{", "this",...
Set the values using the specified Properties object. @param properties Properties object containing specific property values for the RESTClient config Note: We're using the same property names as that in ClientConfig for backwards compatibility.
[ "Set", "the", "values", "using", "the", "specified", "Properties", "object", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/RESTClientConfig.java#L76-L128
160,866
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/CoordinatorConfig.java
CoordinatorConfig.setProperties
private void setProperties(Properties properties) { Props props = new Props(properties); if(props.containsKey(BOOTSTRAP_URLS_PROPERTY)) { setBootstrapURLs(props.getList(BOOTSTRAP_URLS_PROPERTY)); } if(props.containsKey(FAT_CLIENTS_CONFIG_SOURCE)) { setFatClientCo...
java
private void setProperties(Properties properties) { Props props = new Props(properties); if(props.containsKey(BOOTSTRAP_URLS_PROPERTY)) { setBootstrapURLs(props.getList(BOOTSTRAP_URLS_PROPERTY)); } if(props.containsKey(FAT_CLIENTS_CONFIG_SOURCE)) { setFatClientCo...
[ "private", "void", "setProperties", "(", "Properties", "properties", ")", "{", "Props", "props", "=", "new", "Props", "(", "properties", ")", ";", "if", "(", "props", ".", "containsKey", "(", "BOOTSTRAP_URLS_PROPERTY", ")", ")", "{", "setBootstrapURLs", "(", ...
Set the values using the specified Properties object @param properties Properties object containing specific property values for the Coordinator config
[ "Set", "the", "values", "using", "the", "specified", "Properties", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/CoordinatorConfig.java#L115-L173
160,867
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/CoordinatorConfig.java
CoordinatorConfig.setBootstrapURLs
public CoordinatorConfig setBootstrapURLs(List<String> bootstrapUrls) { this.bootstrapURLs = Utils.notNull(bootstrapUrls); if(this.bootstrapURLs.size() <= 0) throw new IllegalArgumentException("Must provide at least one bootstrap URL."); return this; }
java
public CoordinatorConfig setBootstrapURLs(List<String> bootstrapUrls) { this.bootstrapURLs = Utils.notNull(bootstrapUrls); if(this.bootstrapURLs.size() <= 0) throw new IllegalArgumentException("Must provide at least one bootstrap URL."); return this; }
[ "public", "CoordinatorConfig", "setBootstrapURLs", "(", "List", "<", "String", ">", "bootstrapUrls", ")", "{", "this", ".", "bootstrapURLs", "=", "Utils", ".", "notNull", "(", "bootstrapUrls", ")", ";", "if", "(", "this", ".", "bootstrapURLs", ".", "size", "...
Sets the bootstrap URLs used by the different Fat clients inside the Coordinator @param bootstrapUrls list of bootstrap URLs defining which cluster to connect to @return modified CoordinatorConfig
[ "Sets", "the", "bootstrap", "URLs", "used", "by", "the", "different", "Fat", "clients", "inside", "the", "Coordinator" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/CoordinatorConfig.java#L189-L194
160,868
voldemort/voldemort
src/java/voldemort/store/slop/HintedHandoff.java
HintedHandoff.sendOneAsyncHint
private void sendOneAsyncHint(final ByteArray slopKey, final Versioned<byte[]> slopVersioned, final List<Node> nodesToTry) { Node nodeToHostHint = null; boolean foundNode = false; while(nodesToTry.size() > 0) { nodeT...
java
private void sendOneAsyncHint(final ByteArray slopKey, final Versioned<byte[]> slopVersioned, final List<Node> nodesToTry) { Node nodeToHostHint = null; boolean foundNode = false; while(nodesToTry.size() > 0) { nodeT...
[ "private", "void", "sendOneAsyncHint", "(", "final", "ByteArray", "slopKey", ",", "final", "Versioned", "<", "byte", "[", "]", ">", "slopVersioned", ",", "final", "List", "<", "Node", ">", "nodesToTry", ")", "{", "Node", "nodeToHostHint", "=", "null", ";", ...
A callback that handles requestComplete event from NIO selector manager Will try any possible nodes and pass itself as callback util all nodes are exhausted @param slopKey @param slopVersioned @param nodesToTry List of nodes to try to contact. Will become shorter after each callback
[ "A", "callback", "that", "handles", "requestComplete", "event", "from", "NIO", "selector", "manager", "Will", "try", "any", "possible", "nodes", "and", "pass", "itself", "as", "callback", "util", "all", "nodes", "are", "exhausted" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/slop/HintedHandoff.java#L127-L194
160,869
voldemort/voldemort
src/java/voldemort/store/readonly/ExternalSorter.java
ExternalSorter.sorted
public Iterable<V> sorted(Iterator<V> input) { ExecutorService executor = new ThreadPoolExecutor(this.numThreads, this.numThreads, 1000L, ...
java
public Iterable<V> sorted(Iterator<V> input) { ExecutorService executor = new ThreadPoolExecutor(this.numThreads, this.numThreads, 1000L, ...
[ "public", "Iterable", "<", "V", ">", "sorted", "(", "Iterator", "<", "V", ">", "input", ")", "{", "ExecutorService", "executor", "=", "new", "ThreadPoolExecutor", "(", "this", ".", "numThreads", ",", "this", ".", "numThreads", ",", "1000L", ",", "TimeUnit"...
Produce an iterator over the input values in sorted order. Sorting will occur in the fixed space configured in the constructor, data will be dumped to disk as necessary. @param input An iterator over the input values @return An iterator over the values
[ "Produce", "an", "iterator", "over", "the", "input", "values", "in", "sorted", "order", ".", "Sorting", "will", "occur", "in", "the", "fixed", "space", "configured", "in", "the", "constructor", "data", "will", "be", "dumped", "to", "disk", "as", "necessary",...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ExternalSorter.java#L162-L227
160,870
voldemort/voldemort
src/java/voldemort/store/routed/action/PerformParallelPutRequests.java
PerformParallelPutRequests.processResponse
private void processResponse(Response<ByteArray, Object> response, Pipeline pipeline) { if(response == null) { logger.warn("RoutingTimedout on waiting for async ops; parallelResponseToWait: " + numNodesPendingResponse + "; preferred-1: " + (preferred - 1) ...
java
private void processResponse(Response<ByteArray, Object> response, Pipeline pipeline) { if(response == null) { logger.warn("RoutingTimedout on waiting for async ops; parallelResponseToWait: " + numNodesPendingResponse + "; preferred-1: " + (preferred - 1) ...
[ "private", "void", "processResponse", "(", "Response", "<", "ByteArray", ",", "Object", ">", "response", ",", "Pipeline", "pipeline", ")", "{", "if", "(", "response", "==", "null", ")", "{", "logger", ".", "warn", "(", "\"RoutingTimedout on waiting for async ops...
Process the response by reporting proper log and feeding failure detectors @param response @param pipeline
[ "Process", "the", "response", "by", "reporting", "proper", "log", "and", "feeding", "failure", "detectors" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/PerformParallelPutRequests.java#L381-L450
160,871
voldemort/voldemort
src/java/voldemort/store/routed/action/PerformParallelPutRequests.java
PerformParallelPutRequests.isZonesSatisfied
private boolean isZonesSatisfied() { boolean zonesSatisfied = false; if(pipelineData.getZonesRequired() == null) { zonesSatisfied = true; } else { int numZonesSatisfied = pipelineData.getZoneResponses().size(); if(numZonesSatisfied >= (pipelineData.getZonesReq...
java
private boolean isZonesSatisfied() { boolean zonesSatisfied = false; if(pipelineData.getZonesRequired() == null) { zonesSatisfied = true; } else { int numZonesSatisfied = pipelineData.getZoneResponses().size(); if(numZonesSatisfied >= (pipelineData.getZonesReq...
[ "private", "boolean", "isZonesSatisfied", "(", ")", "{", "boolean", "zonesSatisfied", "=", "false", ";", "if", "(", "pipelineData", ".", "getZonesRequired", "(", ")", "==", "null", ")", "{", "zonesSatisfied", "=", "true", ";", "}", "else", "{", "int", "num...
Check if zone count policy is satisfied @return whether zone is satisfied
[ "Check", "if", "zone", "count", "policy", "is", "satisfied" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/PerformParallelPutRequests.java#L466-L477
160,872
voldemort/voldemort
src/java/voldemort/client/ClientConfig.java
ClientConfig.setIdleConnectionTimeout
public ClientConfig setIdleConnectionTimeout(long idleConnectionTimeout, TimeUnit unit) { if (idleConnectionTimeout <= 0) { this.idleConnectionTimeoutMs = -1; } else { if(unit.toMinutes(idleConnectionTimeout) < 10) { throw new IllegalArgumentException("idleConnect...
java
public ClientConfig setIdleConnectionTimeout(long idleConnectionTimeout, TimeUnit unit) { if (idleConnectionTimeout <= 0) { this.idleConnectionTimeoutMs = -1; } else { if(unit.toMinutes(idleConnectionTimeout) < 10) { throw new IllegalArgumentException("idleConnect...
[ "public", "ClientConfig", "setIdleConnectionTimeout", "(", "long", "idleConnectionTimeout", ",", "TimeUnit", "unit", ")", "{", "if", "(", "idleConnectionTimeout", "<=", "0", ")", "{", "this", ".", "idleConnectionTimeoutMs", "=", "-", "1", ";", "}", "else", "{", ...
Set the timeout for idle connections. Voldemort client caches all connections to the Voldemort server. This setting allows the a connection to be dropped, if it is idle for more than this time. This could be useful in the following cases 1) Voldemort client is not directly connected to the server and is connected via ...
[ "Set", "the", "timeout", "for", "idle", "connections", ".", "Voldemort", "client", "caches", "all", "connections", "to", "the", "Voldemort", "server", ".", "This", "setting", "allows", "the", "a", "connection", "to", "be", "dropped", "if", "it", "is", "idle"...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/ClientConfig.java#L617-L627
160,873
voldemort/voldemort
src/java/voldemort/client/ClientConfig.java
ClientConfig.setNodeBannagePeriod
@Deprecated public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, TimeUnit unit) { this.failureDetectorBannagePeriod = unit.toMillis(nodeBannagePeriod); return this; }
java
@Deprecated public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, TimeUnit unit) { this.failureDetectorBannagePeriod = unit.toMillis(nodeBannagePeriod); return this; }
[ "@", "Deprecated", "public", "ClientConfig", "setNodeBannagePeriod", "(", "int", "nodeBannagePeriod", ",", "TimeUnit", "unit", ")", "{", "this", ".", "failureDetectorBannagePeriod", "=", "unit", ".", "toMillis", "(", "nodeBannagePeriod", ")", ";", "return", "this", ...
The period of time to ban a node that gives an error on an operation. @param nodeBannagePeriod The period of time to ban the node @param unit The time unit of the given value @deprecated Use {@link #setFailureDetectorBannagePeriod(long)} instead
[ "The", "period", "of", "time", "to", "ban", "a", "node", "that", "gives", "an", "error", "on", "an", "operation", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/ClientConfig.java#L721-L725
160,874
voldemort/voldemort
src/java/voldemort/client/ClientConfig.java
ClientConfig.setThreadIdleTime
@Deprecated public ClientConfig setThreadIdleTime(long threadIdleTime, TimeUnit unit) { this.threadIdleMs = unit.toMillis(threadIdleTime); return this; }
java
@Deprecated public ClientConfig setThreadIdleTime(long threadIdleTime, TimeUnit unit) { this.threadIdleMs = unit.toMillis(threadIdleTime); return this; }
[ "@", "Deprecated", "public", "ClientConfig", "setThreadIdleTime", "(", "long", "threadIdleTime", ",", "TimeUnit", "unit", ")", "{", "this", ".", "threadIdleMs", "=", "unit", ".", "toMillis", "(", "threadIdleTime", ")", ";", "return", "this", ";", "}" ]
The amount of time to keep an idle client thread alive @param threadIdleTime
[ "The", "amount", "of", "time", "to", "keep", "an", "idle", "client", "thread", "alive" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/ClientConfig.java#L862-L866
160,875
voldemort/voldemort
src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java
ClientRequestExecutorPool.close
@Override public void close(SocketDestination destination) { factory.setLastClosedTimestamp(destination); queuedPool.reset(destination); }
java
@Override public void close(SocketDestination destination) { factory.setLastClosedTimestamp(destination); queuedPool.reset(destination); }
[ "@", "Override", "public", "void", "close", "(", "SocketDestination", "destination", ")", "{", "factory", ".", "setLastClosedTimestamp", "(", "destination", ")", ";", "queuedPool", ".", "reset", "(", "destination", ")", ";", "}" ]
Reset the pool of resources for a specific destination. Idle resources will be destroyed. Checked out resources that are subsequently checked in will be destroyed. Newly created resources can be checked in to reestablish resources for the specific destination.
[ "Reset", "the", "pool", "of", "resources", "for", "a", "specific", "destination", ".", "Idle", "resources", "will", "be", "destroyed", ".", "Checked", "out", "resources", "that", "are", "subsequently", "checked", "in", "will", "be", "destroyed", ".", "Newly", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java#L269-L273
160,876
voldemort/voldemort
src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java
ClientRequestExecutorPool.close
@Override public void close() { // unregister MBeans if(stats != null) { try { if(this.jmxEnabled) JmxUtils.unregisterMbean(getAggregateMetricName()); } catch(Exception e) {} stats.close(); } factory.close(); ...
java
@Override public void close() { // unregister MBeans if(stats != null) { try { if(this.jmxEnabled) JmxUtils.unregisterMbean(getAggregateMetricName()); } catch(Exception e) {} stats.close(); } factory.close(); ...
[ "@", "Override", "public", "void", "close", "(", ")", "{", "// unregister MBeans", "if", "(", "stats", "!=", "null", ")", "{", "try", "{", "if", "(", "this", ".", "jmxEnabled", ")", "JmxUtils", ".", "unregisterMbean", "(", "getAggregateMetricName", "(", ")...
Permanently close the ClientRequestExecutor pool. Resources subsequently checked in will be destroyed.
[ "Permanently", "close", "the", "ClientRequestExecutor", "pool", ".", "Resources", "subsequently", "checked", "in", "will", "be", "destroyed", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java#L279-L291
160,877
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java
HadoopStoreBuilderUtils.readFileContents
public static String readFileContents(FileSystem fs, Path path, int bufferSize) throws IOException { if(bufferSize <= 0) return new String(); FSDataInputStream input = fs.open(path); byte[] buffer = new byte[bufferSize]; ByteArrayOutputStream stream = new ByteAr...
java
public static String readFileContents(FileSystem fs, Path path, int bufferSize) throws IOException { if(bufferSize <= 0) return new String(); FSDataInputStream input = fs.open(path); byte[] buffer = new byte[bufferSize]; ByteArrayOutputStream stream = new ByteAr...
[ "public", "static", "String", "readFileContents", "(", "FileSystem", "fs", ",", "Path", "path", ",", "int", "bufferSize", ")", "throws", "IOException", "{", "if", "(", "bufferSize", "<=", "0", ")", "return", "new", "String", "(", ")", ";", "FSDataInputStream...
Given a filesystem, path and buffer-size, read the file contents and presents it as a string @param fs Underlying filesystem @param path The file to read @param bufferSize The buffer size to use for reading @return The contents of the file as a string @throws IOException
[ "Given", "a", "filesystem", "path", "and", "buffer", "-", "size", "read", "the", "file", "contents", "and", "presents", "it", "as", "a", "string" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java#L52-L73
160,878
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java
HadoopStoreBuilderUtils.getDataChunkFiles
public static FileStatus[] getDataChunkFiles(FileSystem fs, Path path, final int partitionId, final int replicaType) throws IOException { return fs.listStatus(path, ...
java
public static FileStatus[] getDataChunkFiles(FileSystem fs, Path path, final int partitionId, final int replicaType) throws IOException { return fs.listStatus(path, ...
[ "public", "static", "FileStatus", "[", "]", "getDataChunkFiles", "(", "FileSystem", "fs", ",", "Path", "path", ",", "final", "int", "partitionId", ",", "final", "int", "replicaType", ")", "throws", "IOException", "{", "return", "fs", ".", "listStatus", "(", ...
Given a filesystem and path to a node, gets all the files which belong to a partition and replica type Works only for {@link ReadOnlyStorageFormat.READONLY_V2} @param fs Underlying filesystem @param path The node directory path @param partitionId The partition id for which we get the files @param replicaType The repl...
[ "Given", "a", "filesystem", "and", "path", "to", "a", "node", "gets", "all", "the", "files", "which", "belong", "to", "a", "partition", "and", "replica", "type" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java#L88-L103
160,879
voldemort/voldemort
src/java/voldemort/store/routed/action/PerformSerialRequests.java
PerformSerialRequests.isSatisfied
private boolean isSatisfied() { if(pipelineData.getZonesRequired() != null) { return ((pipelineData.getSuccesses() >= required) && (pipelineData.getZoneResponses() .size() >= (pipelineData.getZonesRequired() + 1))); ...
java
private boolean isSatisfied() { if(pipelineData.getZonesRequired() != null) { return ((pipelineData.getSuccesses() >= required) && (pipelineData.getZoneResponses() .size() >= (pipelineData.getZonesRequired() + 1))); ...
[ "private", "boolean", "isSatisfied", "(", ")", "{", "if", "(", "pipelineData", ".", "getZonesRequired", "(", ")", "!=", "null", ")", "{", "return", "(", "(", "pipelineData", ".", "getSuccesses", "(", ")", ">=", "required", ")", "&&", "(", "pipelineData", ...
Checks whether every property except 'preferred' is satisfied @return
[ "Checks", "whether", "every", "property", "except", "preferred", "is", "satisfied" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/PerformSerialRequests.java#L74-L81
160,880
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceBatchPlan.java
RebalanceBatchPlan.getCrossZonePartitionStoreMoves
public int getCrossZonePartitionStoreMoves() { int xzonePartitionStoreMoves = 0; for (RebalanceTaskInfo info : batchPlan) { Node donorNode = finalCluster.getNodeById(info.getDonorId()); Node stealerNode = finalCluster.getNodeById(info.getStealerId()); if(donorNode.ge...
java
public int getCrossZonePartitionStoreMoves() { int xzonePartitionStoreMoves = 0; for (RebalanceTaskInfo info : batchPlan) { Node donorNode = finalCluster.getNodeById(info.getDonorId()); Node stealerNode = finalCluster.getNodeById(info.getStealerId()); if(donorNode.ge...
[ "public", "int", "getCrossZonePartitionStoreMoves", "(", ")", "{", "int", "xzonePartitionStoreMoves", "=", "0", ";", "for", "(", "RebalanceTaskInfo", "info", ":", "batchPlan", ")", "{", "Node", "donorNode", "=", "finalCluster", ".", "getNodeById", "(", "info", "...
Determines total number of partition-stores moved across zones. @return number of cross zone partition-store moves
[ "Determines", "total", "number", "of", "partition", "-", "stores", "moved", "across", "zones", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceBatchPlan.java#L150-L162
160,881
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceBatchPlan.java
RebalanceBatchPlan.getDonorId
protected int getDonorId(StoreRoutingPlan currentSRP, StoreRoutingPlan finalSRP, int stealerZoneId, int stealerNodeId, int stealerPartitionId) { int stealerZoneNAry = finalSRP.getZoneNaryForNodesP...
java
protected int getDonorId(StoreRoutingPlan currentSRP, StoreRoutingPlan finalSRP, int stealerZoneId, int stealerNodeId, int stealerPartitionId) { int stealerZoneNAry = finalSRP.getZoneNaryForNodesP...
[ "protected", "int", "getDonorId", "(", "StoreRoutingPlan", "currentSRP", ",", "StoreRoutingPlan", "finalSRP", ",", "int", "stealerZoneId", ",", "int", "stealerNodeId", ",", "int", "stealerPartitionId", ")", "{", "int", "stealerZoneNAry", "=", "finalSRP", ".", "getZo...
Decide which donor node to steal from. This is a policy implementation. I.e., in the future, additional policies could be considered. At that time, this method should be overridden in a sub-class, or a policy object ought to implement this algorithm. Current policy: 1) If possible, a stealer node that is the zone n-a...
[ "Decide", "which", "donor", "node", "to", "steal", "from", ".", "This", "is", "a", "policy", "implementation", ".", "I", ".", "e", ".", "in", "the", "future", "additional", "policies", "could", "be", "considered", ".", "At", "that", "time", "this", "meth...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceBatchPlan.java#L351-L372
160,882
voldemort/voldemort
src/java/voldemort/rest/RestErrorHandler.java
RestErrorHandler.handleExceptions
protected void handleExceptions(MessageEvent messageEvent, Exception exception) { logger.error("Unknown exception. Internal Server Error.", exception); writeErrorResponse(messageEvent, HttpResponseStatus.INTERNAL_SERVER_ERROR, "Internal Server Error"...
java
protected void handleExceptions(MessageEvent messageEvent, Exception exception) { logger.error("Unknown exception. Internal Server Error.", exception); writeErrorResponse(messageEvent, HttpResponseStatus.INTERNAL_SERVER_ERROR, "Internal Server Error"...
[ "protected", "void", "handleExceptions", "(", "MessageEvent", "messageEvent", ",", "Exception", "exception", ")", "{", "logger", ".", "error", "(", "\"Unknown exception. Internal Server Error.\"", ",", "exception", ")", ";", "writeErrorResponse", "(", "messageEvent", ",...
Exceptions specific to each operation is handled in the corresponding subclass. At this point we don't know the reason behind this exception. @param exception
[ "Exceptions", "specific", "to", "each", "operation", "is", "handled", "in", "the", "corresponding", "subclass", ".", "At", "this", "point", "we", "don", "t", "know", "the", "reason", "behind", "this", "exception", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestErrorHandler.java#L25-L30
160,883
voldemort/voldemort
src/java/voldemort/rest/RestErrorHandler.java
RestErrorHandler.writeErrorResponse
public static void writeErrorResponse(MessageEvent messageEvent, HttpResponseStatus status, String message) { // Create the Response object HttpResponse response = new DefaultHttpResponse(HTTP_1_1, status); resp...
java
public static void writeErrorResponse(MessageEvent messageEvent, HttpResponseStatus status, String message) { // Create the Response object HttpResponse response = new DefaultHttpResponse(HTTP_1_1, status); resp...
[ "public", "static", "void", "writeErrorResponse", "(", "MessageEvent", "messageEvent", ",", "HttpResponseStatus", "status", ",", "String", "message", ")", "{", "// Create the Response object", "HttpResponse", "response", "=", "new", "DefaultHttpResponse", "(", "HTTP_1_1",...
Writes all error responses to the client. TODO REST-Server 1. collect error stats @param messageEvent - for retrieving the channel details @param status - error code @param message - error message
[ "Writes", "all", "error", "responses", "to", "the", "client", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestErrorHandler.java#L41-L54
160,884
voldemort/voldemort
src/java/voldemort/rest/RestPutRequestValidator.java
RestPutRequestValidator.parseAndValidateRequest
@Override public boolean parseAndValidateRequest() { boolean result = false; if(!super.parseAndValidateRequest() || !hasVectorClock(this.isVectorClockOptional) || !hasContentLength() || !hasContentType()) { result = false; } else { result = true; } ...
java
@Override public boolean parseAndValidateRequest() { boolean result = false; if(!super.parseAndValidateRequest() || !hasVectorClock(this.isVectorClockOptional) || !hasContentLength() || !hasContentType()) { result = false; } else { result = true; } ...
[ "@", "Override", "public", "boolean", "parseAndValidateRequest", "(", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "!", "super", ".", "parseAndValidateRequest", "(", ")", "||", "!", "hasVectorClock", "(", "this", ".", "isVectorClockOptional", "...
Validations specific to PUT
[ "Validations", "specific", "to", "PUT" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestPutRequestValidator.java#L78-L89
160,885
voldemort/voldemort
src/java/voldemort/rest/RestPutRequestValidator.java
RestPutRequestValidator.hasContentLength
protected boolean hasContentLength() { boolean result = false; String contentLength = this.request.getHeader(RestMessageHeaders.CONTENT_LENGTH); if(contentLength != null) { try { Long.parseLong(contentLength); result = true; } catch(NumberF...
java
protected boolean hasContentLength() { boolean result = false; String contentLength = this.request.getHeader(RestMessageHeaders.CONTENT_LENGTH); if(contentLength != null) { try { Long.parseLong(contentLength); result = true; } catch(NumberF...
[ "protected", "boolean", "hasContentLength", "(", ")", "{", "boolean", "result", "=", "false", ";", "String", "contentLength", "=", "this", ".", "request", ".", "getHeader", "(", "RestMessageHeaders", ".", "CONTENT_LENGTH", ")", ";", "if", "(", "contentLength", ...
Retrieves and validates the content length from the REST request. @return true if has content length
[ "Retrieves", "and", "validates", "the", "content", "length", "from", "the", "REST", "request", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestPutRequestValidator.java#L96-L121
160,886
voldemort/voldemort
src/java/voldemort/rest/RestPutRequestValidator.java
RestPutRequestValidator.hasContentType
protected boolean hasContentType() { boolean result = false; if(this.request.getHeader(RestMessageHeaders.CONTENT_TYPE) != null) { result = true; } else { logger.error("Error when validating put request. Missing Content-Type header."); RestErrorHandler.writeE...
java
protected boolean hasContentType() { boolean result = false; if(this.request.getHeader(RestMessageHeaders.CONTENT_TYPE) != null) { result = true; } else { logger.error("Error when validating put request. Missing Content-Type header."); RestErrorHandler.writeE...
[ "protected", "boolean", "hasContentType", "(", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "this", ".", "request", ".", "getHeader", "(", "RestMessageHeaders", ".", "CONTENT_TYPE", ")", "!=", "null", ")", "{", "result", "=", "true", ";", ...
Retrieves and validates the content type from the REST requests @return true if has content type.
[ "Retrieves", "and", "validates", "the", "content", "type", "from", "the", "REST", "requests" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestPutRequestValidator.java#L128-L140
160,887
voldemort/voldemort
src/java/voldemort/rest/RestPutRequestValidator.java
RestPutRequestValidator.parseValue
private void parseValue() { ChannelBuffer content = this.request.getContent(); this.parsedValue = new byte[content.capacity()]; content.readBytes(parsedValue); }
java
private void parseValue() { ChannelBuffer content = this.request.getContent(); this.parsedValue = new byte[content.capacity()]; content.readBytes(parsedValue); }
[ "private", "void", "parseValue", "(", ")", "{", "ChannelBuffer", "content", "=", "this", ".", "request", ".", "getContent", "(", ")", ";", "this", ".", "parsedValue", "=", "new", "byte", "[", "content", ".", "capacity", "(", ")", "]", ";", "content", "...
Retrieve the value from the REST request body. TODO: REST-Server value cannot be null ( null/empty string ?)
[ "Retrieve", "the", "value", "from", "the", "REST", "request", "body", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestPutRequestValidator.java#L147-L151
160,888
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/swapper/HdfsFailedFetchLock.java
HdfsFailedFetchLock.handleIOException
private void handleIOException(IOException e, String action, int attempt) throws VoldemortException, InterruptedException { if ( // any of the following happens, we need to bubble up // FileSystem instance got closed, somehow e.getMessage().contains("Filesystem closed...
java
private void handleIOException(IOException e, String action, int attempt) throws VoldemortException, InterruptedException { if ( // any of the following happens, we need to bubble up // FileSystem instance got closed, somehow e.getMessage().contains("Filesystem closed...
[ "private", "void", "handleIOException", "(", "IOException", "e", ",", "String", "action", ",", "int", "attempt", ")", "throws", "VoldemortException", ",", "InterruptedException", "{", "if", "(", "// any of the following happens, we need to bubble up", "// FileSystem instanc...
This function is intended to detect the subset of IOException which are not considered recoverable, in which case we want to bubble up the exception, instead of retrying. @throws VoldemortException
[ "This", "function", "is", "intended", "to", "detect", "the", "subset", "of", "IOException", "which", "are", "not", "considered", "recoverable", "in", "which", "case", "we", "want", "to", "bubble", "up", "the", "exception", "instead", "of", "retrying", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/swapper/HdfsFailedFetchLock.java#L186-L198
160,889
voldemort/voldemort
src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java
AbstractFailureDetector.setAvailable
private boolean setAvailable(NodeStatus nodeStatus, boolean isAvailable) { synchronized(nodeStatus) { boolean previous = nodeStatus.isAvailable(); nodeStatus.setAvailable(isAvailable); nodeStatus.setLastChecked(getConfig().getTime().getMilliseconds()); return pr...
java
private boolean setAvailable(NodeStatus nodeStatus, boolean isAvailable) { synchronized(nodeStatus) { boolean previous = nodeStatus.isAvailable(); nodeStatus.setAvailable(isAvailable); nodeStatus.setLastChecked(getConfig().getTime().getMilliseconds()); return pr...
[ "private", "boolean", "setAvailable", "(", "NodeStatus", "nodeStatus", ",", "boolean", "isAvailable", ")", "{", "synchronized", "(", "nodeStatus", ")", "{", "boolean", "previous", "=", "nodeStatus", ".", "isAvailable", "(", ")", ";", "nodeStatus", ".", "setAvail...
We need to distinguish the case where we're newly available and the case where we're already available. So we check the node status before we update it and return it to the caller. @param isAvailable True to set to available, false to make unavailable @return Previous value of isAvailable
[ "We", "need", "to", "distinguish", "the", "case", "where", "we", "re", "newly", "available", "and", "the", "case", "where", "we", "re", "already", "available", ".", "So", "we", "check", "the", "node", "status", "before", "we", "update", "it", "and", "ret...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java#L273-L282
160,890
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsDir
public static void acceptsDir(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_D, OPT_DIR), "directory path for input/output") .withRequiredArg() .describedAs("dir-path") .ofType(String.class); }
java
public static void acceptsDir(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_D, OPT_DIR), "directory path for input/output") .withRequiredArg() .describedAs("dir-path") .ofType(String.class); }
[ "public", "static", "void", "acceptsDir", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_D", ",", "OPT_DIR", ")", ",", "\"directory path for input/output\"", ")", ".", "withRequiredArg", "(", ")", ...
Adds OPT_D | OPT_DIR option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_D", "|", "OPT_DIR", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L148-L153
160,891
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsFile
public static void acceptsFile(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_F, OPT_FILE), "file path for input/output") .withRequiredArg() .describedAs("file-path") .ofType(String.class); }
java
public static void acceptsFile(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_F, OPT_FILE), "file path for input/output") .withRequiredArg() .describedAs("file-path") .ofType(String.class); }
[ "public", "static", "void", "acceptsFile", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_F", ",", "OPT_FILE", ")", ",", "\"file path for input/output\"", ")", ".", "withRequiredArg", "(", ")", "."...
Adds OPT_F | OPT_FILE option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_F", "|", "OPT_FILE", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L161-L166
160,892
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsFormat
public static void acceptsFormat(OptionParser parser) { parser.accepts(OPT_FORMAT, "format of key or entry, could be hex, json or binary") .withRequiredArg() .describedAs("hex | json | binary") .ofType(String.class); }
java
public static void acceptsFormat(OptionParser parser) { parser.accepts(OPT_FORMAT, "format of key or entry, could be hex, json or binary") .withRequiredArg() .describedAs("hex | json | binary") .ofType(String.class); }
[ "public", "static", "void", "acceptsFormat", "(", "OptionParser", "parser", ")", "{", "parser", ".", "accepts", "(", "OPT_FORMAT", ",", "\"format of key or entry, could be hex, json or binary\"", ")", ".", "withRequiredArg", "(", ")", ".", "describedAs", "(", "\"hex |...
Adds OPT_FORMAT option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_FORMAT", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L174-L179
160,893
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsNodeSingle
public static void acceptsNodeSingle(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_N, OPT_NODE), "node id") .withRequiredArg() .describedAs("node-id") .ofType(Integer.class); }
java
public static void acceptsNodeSingle(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_N, OPT_NODE), "node id") .withRequiredArg() .describedAs("node-id") .ofType(Integer.class); }
[ "public", "static", "void", "acceptsNodeSingle", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_N", ",", "OPT_NODE", ")", ",", "\"node id\"", ")", ".", "withRequiredArg", "(", ")", ".", "describe...
Adds OPT_N | OPT_NODE option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_N", "|", "OPT_NODE", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L187-L192
160,894
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsUrl
public static void acceptsUrl(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_U, OPT_URL), "bootstrap url") .withRequiredArg() .describedAs("url") .ofType(String.class); }
java
public static void acceptsUrl(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_U, OPT_URL), "bootstrap url") .withRequiredArg() .describedAs("url") .ofType(String.class); }
[ "public", "static", "void", "acceptsUrl", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_U", ",", "OPT_URL", ")", ",", "\"bootstrap url\"", ")", ".", "withRequiredArg", "(", ")", ".", "describedA...
Adds OPT_U | OPT_URL option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_U", "|", "OPT_URL", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L213-L218
160,895
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsZone
public static void acceptsZone(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_Z, OPT_ZONE), "zone id") .withRequiredArg() .describedAs("zone-id") .ofType(Integer.class); }
java
public static void acceptsZone(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_Z, OPT_ZONE), "zone id") .withRequiredArg() .describedAs("zone-id") .ofType(Integer.class); }
[ "public", "static", "void", "acceptsZone", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_Z", ",", "OPT_ZONE", ")", ",", "\"zone id\"", ")", ".", "withRequiredArg", "(", ")", ".", "describedAs", ...
Adds OPT_Z | OPT_ZONE option to OptionParser, with one argument. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_Z", "|", "OPT_ZONE", "option", "to", "OptionParser", "with", "one", "argument", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L226-L231
160,896
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsHex
public static void acceptsHex(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_X, OPT_HEX), "fetch key/entry by key value of hex type") .withRequiredArg() .describedAs("key-list") .withValuesSeparatedBy(',') .ofType(String.class); }
java
public static void acceptsHex(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_X, OPT_HEX), "fetch key/entry by key value of hex type") .withRequiredArg() .describedAs("key-list") .withValuesSeparatedBy(',') .ofType(String.class); }
[ "public", "static", "void", "acceptsHex", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_X", ",", "OPT_HEX", ")", ",", "\"fetch key/entry by key value of hex type\"", ")", ".", "withRequiredArg", "(", ...
Adds OPT_X | OPT_HEX option to OptionParser, with multiple arguments. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_X", "|", "OPT_HEX", "option", "to", "OptionParser", "with", "multiple", "arguments", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L239-L245
160,897
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsJson
public static void acceptsJson(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_J, OPT_JSON), "fetch key/entry by key value of json type") .withRequiredArg() .describedAs("key-list") .withValuesSeparatedBy(',') .ofType(S...
java
public static void acceptsJson(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_J, OPT_JSON), "fetch key/entry by key value of json type") .withRequiredArg() .describedAs("key-list") .withValuesSeparatedBy(',') .ofType(S...
[ "public", "static", "void", "acceptsJson", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_J", ",", "OPT_JSON", ")", ",", "\"fetch key/entry by key value of json type\"", ")", ".", "withRequiredArg", "(...
Adds OPT_J | OPT_JSON option to OptionParser, with multiple arguments. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_J", "|", "OPT_JSON", "option", "to", "OptionParser", "with", "multiple", "arguments", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L253-L260
160,898
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsNodeMultiple
public static void acceptsNodeMultiple(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_N, OPT_NODE), "node id list") .withRequiredArg() .describedAs("node-id-list") .withValuesSeparatedBy(',') .ofType(Integer.class); }
java
public static void acceptsNodeMultiple(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_N, OPT_NODE), "node id list") .withRequiredArg() .describedAs("node-id-list") .withValuesSeparatedBy(',') .ofType(Integer.class); }
[ "public", "static", "void", "acceptsNodeMultiple", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_N", ",", "OPT_NODE", ")", ",", "\"node id list\"", ")", ".", "withRequiredArg", "(", ")", ".", "d...
Adds OPT_N | OPT_NODE option to OptionParser, with multiple arguments. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_N", "|", "OPT_NODE", "option", "to", "OptionParser", "with", "multiple", "arguments", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L268-L274
160,899
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.acceptsPartition
public static void acceptsPartition(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_P, OPT_PARTITION), "partition id list") .withRequiredArg() .describedAs("partition-id-list") .withValuesSeparatedBy(',') .ofType(Integer.class); }
java
public static void acceptsPartition(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_P, OPT_PARTITION), "partition id list") .withRequiredArg() .describedAs("partition-id-list") .withValuesSeparatedBy(',') .ofType(Integer.class); }
[ "public", "static", "void", "acceptsPartition", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_P", ",", "OPT_PARTITION", ")", ",", "\"partition id list\"", ")", ".", "withRequiredArg", "(", ")", "....
Adds OPT_P | OPT_PARTITION option to OptionParser, with multiple arguments. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_P", "|", "OPT_PARTITION", "option", "to", "OptionParser", "with", "multiple", "arguments", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L283-L289