while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef); byteSegmentRef = hashMapResult.next();
@Override public List<Object> next() throws HiveException { if (dummyRow != null) { // TODO: what should we do if first was never called? for now, assert for clarity if (!wasFirstCalledOnDummyRow) { throw new AssertionError("next called without first"); } return null; } WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef); byteSegmentRef = hashMapResult.next();
while (byteSegmentRef != null) { results.add(hashMapResult.byteSegmentRef); byteSegmentRef = hashMapResult.next();
@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 ByteSegmentRef next() { return bytesBytesMultiHashMapResult.next(); }
@Override public List<Object> next() throws HiveException { WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return uppack(byteSegmentRef); } }
@Override public List<Object> next() throws HiveException { WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return uppack(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 ByteSegmentRef next() { return bytesBytesMultiHashMapResult.next(); }
@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> next() throws HiveException { WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
@Override public List<Object> next() throws HiveException { WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }
@Override public ByteSegmentRef next() { return bytesBytesMultiHashMapResult.next(); }
@Override public List<Object> next() throws HiveException { WriteBuffers.ByteSegmentRef byteSegmentRef = hashMapResult.next(); if (byteSegmentRef == null) { return null; } else { return unpack(byteSegmentRef); } }