/** * {@inheritDoc} * <p> * Returns true if this map contains the specified object. */ @Override public boolean contains(AnyObjectId toFind) { return get(toFind) != null; }
private void indexId(ObjectId id, long blockPos) { if (id != null) { RefList l = obj2ref.get(id); if (l == null) { l = new RefList(id); obj2ref.add(l); } l.addBlock(blockPos); } }
/** * Returns true if this map contains the specified object. * * @param toFind * object to find. * @return true if the mapping exists for this object; false otherwise. */ public boolean contains(final AnyObjectId toFind) { return get(toFind) != null; }
/** * {@inheritDoc} * <p> * Returns true if this map contains the specified object. */ @Override public boolean contains(AnyObjectId toFind) { return get(toFind) != null; }
ChunkKey findChunk(AnyObjectId id) { RefCache c = cache.get(); if (c != null) { IdWithChunk i = c.hints.get(id); if (i != null) return i.getChunkKey(); } return null; }
ChunkKey findChunk(AnyObjectId id) { RefCache c = cache.get(); if (c != null) { IdWithChunk i = c.hints.get(id); if (i != null) return i.getChunkKey(); } return null; }
private DhtInfo lookupByName(AnyObjectId obj) { DhtInfo info = objectMap.get(obj); if (info == null) { info = new DhtInfo(obj); objectMap.add(info); } return info; }
private DhtInfo lookupByName(AnyObjectId obj) { DhtInfo info = objectMap.get(obj); if (info == null) { info = new DhtInfo(obj); objectMap.add(info); } return info; }
private void indexId(ObjectId id, long blockPos) { if (id != null) { RefList l = obj2ref.get(id); if (l == null) { l = new RefList(id); obj2ref.add(l); } l.addBlock(blockPos); } }
@Override protected void onBeginRefDelta(long deltaPos, AnyObjectId baseId, long inflatedSize) throws IOException { // Try to get the base type, but only if it was seen before in this // pack stream. If not assume worst-case of BLOB type. // int typeCode; DhtInfo baseInfo = objectMap.get(baseId); if (baseInfo != null && baseInfo.isInPack()) { typeCode = baseInfo.getType(); currType = typeCode; } else { typeCode = OBJ_BLOB; currType = -1; } ChunkFormatter w = begin(typeCode); if (!w.refDelta(inflatedSize, baseId)) { endChunk(typeCode); w = begin(typeCode); if (!w.refDelta(inflatedSize, baseId)) throw panicCannotInsert(); } currDataPos = w.position(); currPackedSize = 0; currInflatedSize = inflatedSize; objStreamPos.add(deltaPos); }
@Override protected void onBeginRefDelta(long deltaPos, AnyObjectId baseId, long inflatedSize) throws IOException { // Try to get the base type, but only if it was seen before in this // pack stream. If not assume worst-case of BLOB type. // int typeCode; DhtInfo baseInfo = objectMap.get(baseId); if (baseInfo != null && baseInfo.isInPack()) { typeCode = baseInfo.getType(); currType = typeCode; } else { typeCode = OBJ_BLOB; currType = -1; } ChunkFormatter w = begin(typeCode); if (!w.refDelta(inflatedSize, baseId)) { endChunk(typeCode); w = begin(typeCode); if (!w.refDelta(inflatedSize, baseId)) throw panicCannotInsert(); } currDataPos = w.position(); currPackedSize = 0; currInflatedSize = inflatedSize; objStreamPos.add(deltaPos); }