private void putChunkIndexes() throws DhtException { List<DhtInfo> objs = objectListByChunk; int sIdx = 0; DhtInfo oe = objs.get(0); oe.setOffset(offsetOf(oe.chunkPtr)); ChunkKey key = chunkOf(oe.chunkPtr); int type = typeOf(oe.chunkPtr); int objIdx = 1; for (; objIdx < objs.size(); objIdx++) { oe = objs.get(objIdx); oe.setOffset(offsetOf(oe.chunkPtr)); ChunkKey oeKey = chunkOf(oe.chunkPtr); if (!key.equals(oeKey)) { putChunkIndex(objs.subList(sIdx, objIdx), key, type); sIdx = objIdx; key = oeKey; type = typeOf(oe.chunkPtr); } if (type != OBJ_MIXED && type != typeOf(oe.chunkPtr)) type = OBJ_MIXED; } putChunkIndex(objs.subList(sIdx, objs.size()), key, type); }
private void putChunkIndexes() throws DhtException { List<DhtInfo> objs = objectListByChunk; int sIdx = 0; DhtInfo oe = objs.get(0); oe.setOffset(offsetOf(oe.chunkPtr)); ChunkKey key = chunkOf(oe.chunkPtr); int type = typeOf(oe.chunkPtr); int objIdx = 1; for (; objIdx < objs.size(); objIdx++) { oe = objs.get(objIdx); oe.setOffset(offsetOf(oe.chunkPtr)); ChunkKey oeKey = chunkOf(oe.chunkPtr); if (!key.equals(oeKey)) { putChunkIndex(objs.subList(sIdx, objIdx), key, type); sIdx = objIdx; key = oeKey; type = typeOf(oe.chunkPtr); } if (type != OBJ_MIXED && type != typeOf(oe.chunkPtr)) type = OBJ_MIXED; } putChunkIndex(objs.subList(sIdx, objs.size()), key, type); }