@Override public ByteSegmentRef first() { if (joinResult() != JoinUtil.JoinResult.MATCH) { throw new RuntimeException("HashMapResult is not a match"); } return bytesBytesMultiHashMapResult.first(); }
getValueResult(key, 0, key.length, hashMapResult, null); List<WriteBuffers.ByteSegmentRef> results = new ArrayList<WriteBuffers.ByteSegmentRef>(); WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef);
@Override public ByteSegmentRef first() { if (joinResult() != JoinUtil.JoinResult.MATCH) { throw new RuntimeException("HashMapResult is not a match"); } return bytesBytesMultiHashMapResult.first(); }
getValueResult(key, 0, key.length, hashMapResult); List<WriteBuffers.ByteSegmentRef> results = new ArrayList<WriteBuffers.ByteSegmentRef>(); WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef);
@Override public long count() { if (!haveCount) { if (bytesBytesMultiHashMapResult.isSingleRow()) { count = 1; } else { count = 0; ByteSegmentRef byteSegmentRef = bytesBytesMultiHashMapResult.first(); while (byteSegmentRef != null) { count++; byteSegmentRef = bytesBytesMultiHashMapResult.next(); } } haveCount = true; } return count; }
@Override public List<Object> first() throws HiveException { // A little strange that we forget the dummy row on read. if (dummyRow != null) { List<Object> result = dummyRow; dummyRow = null; return result; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return uppack(byteSegmentRef); } }
@Override public List<Object> first() throws HiveException { // A little strange that we forget the dummy row on read. if (dummyRow != null) { List<Object> result = dummyRow; dummyRow = null; return result; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return uppack(byteSegmentRef); } }
@Override public ByteSegmentRef first() { if (joinResult() != JoinUtil.JoinResult.MATCH) { throw new RuntimeException("HashMapResult is not a match"); } return bytesBytesMultiHashMapResult.first(); }
getValueResult(key, 0, key.length, hashMapResult); List<WriteBuffers.ByteSegmentRef> results = new ArrayList<WriteBuffers.ByteSegmentRef>(); WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef);
@Override public long count() { if (!haveCount) { if (bytesBytesMultiHashMapResult.isSingleRow()) { count = 1; } else { count = 0; ByteSegmentRef byteSegmentRef = bytesBytesMultiHashMapResult.first(); while (byteSegmentRef != null) { count++; byteSegmentRef = bytesBytesMultiHashMapResult.next(); } } haveCount = true; } return count; }
private void verifyHashMapResult(BytesBytesMultiHashMap map, byte[] key, byte[]... values) { BytesBytesMultiHashMap.Result hashMapResult = new BytesBytesMultiHashMap.Result(); byte state = map.getValueResult(key, 0, key.length, hashMapResult, null); HashSet<ByteBuffer> hs = new HashSet<ByteBuffer>(); int count = 0; if (hashMapResult.hasRows()) { WriteBuffers.ByteSegmentRef ref = hashMapResult.first(); while (ref != null) { count++; hs.add(ref.copy()); ref = hashMapResult.next(); } } assertEquals(state, count); assertEquals(values.length, count); for (int i = 0; i < values.length; ++i) { assertTrue(hs.contains(ByteBuffer.wrap(values[i]))); } }
@Override public List<Object> first() throws HiveException { // A little strange that we forget the dummy row on read. if (dummyRow != null) { List<Object> result = dummyRow; dummyRow = null; return result; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
@Override public List<Object> first() throws HiveException { // A little strange that we forget the dummy row on read. if (dummyRow != null) { List<Object> result = dummyRow; dummyRow = null; return result; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
@Override public long count() { if (!haveCount) { if (bytesBytesMultiHashMapResult.isSingleRow()) { count = 1; } else { count = 0; ByteSegmentRef byteSegmentRef = bytesBytesMultiHashMapResult.first(); while (byteSegmentRef != null) { count++; byteSegmentRef = bytesBytesMultiHashMapResult.next(); } } haveCount = true; } return count; }
@Override public List<Object> first() throws HiveException { // A little strange that we forget the dummy row on read. if (dummyRow != null) { List<Object> result = dummyRow; dummyRow = null; return result; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
@Override public List<Object> first() throws HiveException { if (dummyRow != null) { wasFirstCalledOnDummyRow = true; return dummyRow; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.first(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }