Code example for Map

Methods: clear, putAll

0
 
        @Override 
        protected Map setCurrentValue(Map oldApiValue, Map newApiKey, Object object) {
            Map map = (Map) object;
            if (oldApiValue != null) {
                oldApiValue.clear();
                oldApiValue.putAll(map);
            } 
            else { 
                oldApiValue = map;
            } 
            newApiKey = map;
            return oldApiValue;
        } 
    } 
 
    @Override 
    public ShardRecordReader createRecordReader(InputSplit split, TaskAttemptContext context) {
        return new PigShardRecordReader(); 
    }