MCPcopy Create free account
hub / github.com/apache/pig / put

Method put

src/org/apache/pig/newplan/PlanEdge.java:52–65  ·  view source on GitHub ↗

Add an element to the map. @param key The key to store the value under. If the key already exists the value will be added to the collection for that key, it will not replace the existing value (as in a standard map). @param value value to store. @param pos position in the arraylist to store the new

(Operator key, Operator value, int pos)

Source from the content-addressed store, hash-verified

50 * Positions are zero based.
51 */
52 public void put(Operator key, Operator value, int pos) {
53 ArrayList<Operator> list = mMap.get(key);
54 if (list == null) {
55 list = new ArrayList<Operator>();
56 if (pos != 0) {
57 throw new IndexOutOfBoundsException(
58 "First edge cannot have position greater than 1");
59 }
60 list.add(value);
61 mMap.put(key, list);
62 } else {
63 list.add(pos, value);
64 }
65 }
66
67 /**
68 * Remove one value from an existing key and return which position in

Callers 15

testPlanEdgeInsertMethod · 0.95
shallowCloneMethod · 0.95
setUpMethod · 0.45
testReplaceMultiUDFMethod · 0.45
TestHostExtractorClass · 0.45
getNextMethod · 0.45
getStoreMethod · 0.45
processOneInRecordMethod · 0.45

Calls 2

getMethod · 0.65
addMethod · 0.65

Tested by 5

testPlanEdgeInsertMethod · 0.76
setUpMethod · 0.36
testReplaceMultiUDFMethod · 0.36