@Override public void digest(MessageDigest digest) { super.digest(digest); FBUtilities.updateWithInt(digest, localExpirationTime); FBUtilities.updateWithInt(digest, ttl); }
@Override public void digest(MessageDigest digest) { super.digest(digest); FBUtilities.updateWithInt(digest, localExpirationTime); FBUtilities.updateWithInt(digest, ttl); }
@Override public void digest(MessageDigest digest) { super.digest(digest); FBUtilities.updateWithInt(digest, localExpirationTime); FBUtilities.updateWithInt(digest, ttl); }
@Override public void digest(MessageDigest digest) { super.digest(digest); FBUtilities.updateWithInt(digest, localExpirationTime); FBUtilities.updateWithInt(digest, ttl); }
@Override public void updateDigest(MessageDigest digest) { super.updateDigest(digest); FBUtilities.updateWithInt(digest, timeToLive); }
private static byte[] hash(Collection<InetAddress> data) { try { // Identify the host. MessageDigest messageDigest = MessageDigest.getInstance("MD5"); for(InetAddress addr : data) messageDigest.update(addr.getAddress()); //TODO: Minh - is it ok? // Identify the process on the load: we use both the PID and class loader hash. //long pid = SigarLibrary.instance.getPid(); //if (pid < 0) long pid = new Random(System.currentTimeMillis()).nextLong(); FBUtilities.updateWithLong(messageDigest, pid); ClassLoader loader = UUIDGen.class.getClassLoader(); int loaderId = loader != null ? System.identityHashCode(loader) : 0; FBUtilities.updateWithInt(messageDigest, loaderId); return messageDigest.digest(); } catch (NoSuchAlgorithmException nsae) { throw new RuntimeException("MD5 digest algorithm is not available", nsae); } } }
private static byte[] hash(Collection<InetAddress> data) { try { // Identify the host. MessageDigest messageDigest = MessageDigest.getInstance("MD5"); for(InetAddress addr : data) messageDigest.update(addr.getAddress()); // Identify the process on the load: we use both the PID and class loader hash. long pid = NativeLibrary.getProcessID(); if (pid < 0) pid = new Random(System.currentTimeMillis()).nextLong(); FBUtilities.updateWithLong(messageDigest, pid); ClassLoader loader = UUIDGen.class.getClassLoader(); int loaderId = loader != null ? System.identityHashCode(loader) : 0; FBUtilities.updateWithInt(messageDigest, loaderId); return messageDigest.digest(); } catch (NoSuchAlgorithmException nsae) { throw new RuntimeException("MD5 digest algorithm is not available", nsae); } } }
private static byte[] hash(Collection<InetAddress> data) { try { // Identify the host. MessageDigest messageDigest = MessageDigest.getInstance("MD5"); for(InetAddress addr : data) messageDigest.update(addr.getAddress()); // Identify the process on the load: we use both the PID and class loader hash. long pid = NativeLibrary.getProcessID(); if (pid < 0) pid = new Random(System.currentTimeMillis()).nextLong(); FBUtilities.updateWithLong(messageDigest, pid); ClassLoader loader = UUIDGen.class.getClassLoader(); int loaderId = loader != null ? System.identityHashCode(loader) : 0; FBUtilities.updateWithInt(messageDigest, loaderId); return messageDigest.digest(); } catch (NoSuchAlgorithmException nsae) { throw new RuntimeException("MD5 digest algorithm is not available", nsae); } } }
private static byte[] hash(Collection<InetAddress> data) { try { // Identify the host. MessageDigest messageDigest = MessageDigest.getInstance("MD5"); for(InetAddress addr : data) messageDigest.update(addr.getAddress()); // Identify the process on the load: we use both the PID and class loader hash. long pid = NativeLibrary.getProcessID(); if (pid < 0) pid = new Random(System.currentTimeMillis()).nextLong(); FBUtilities.updateWithLong(messageDigest, pid); ClassLoader loader = UUIDGen.class.getClassLoader(); int loaderId = loader != null ? System.identityHashCode(loader) : 0; FBUtilities.updateWithInt(messageDigest, loaderId); return messageDigest.digest(); } catch (NoSuchAlgorithmException nsae) { throw new RuntimeException("MD5 digest algorithm is not available", nsae); } } }
private static byte[] hash(Collection<InetAddress> data) { try { // Identify the host. MessageDigest messageDigest = MessageDigest.getInstance("MD5"); for(InetAddress addr : data) messageDigest.update(addr.getAddress()); // Identify the process on the load: we use both the PID and class loader hash. long pid = SigarLibrary.instance.getPid(); if (pid < 0) pid = new Random(System.currentTimeMillis()).nextLong(); FBUtilities.updateWithLong(messageDigest, pid); ClassLoader loader = UUIDGen.class.getClassLoader(); int loaderId = loader != null ? System.identityHashCode(loader) : 0; FBUtilities.updateWithInt(messageDigest, loaderId); return messageDigest.digest(); } catch (NoSuchAlgorithmException nsae) { throw new RuntimeException("MD5 digest algorithm is not available", nsae); } } }
@Override public void updateDigest(MessageDigest digest) { super.updateDigest(digest); FBUtilities.updateWithInt(digest, getTimeToLive()); }
public void digest(MessageDigest digest) { digest.update(value().duplicate()); FBUtilities.updateWithLong(digest, timestamp()); FBUtilities.updateWithInt(digest, ttl()); FBUtilities.updateWithBoolean(digest, isCounterCell()); if (path() != null) path().digest(digest); }
public void digest(CFMetaData metadata, MessageDigest digest) { for (LegacyCell cell : cells) { digest.update(cell.name.encode(metadata).duplicate()); if (cell.isCounter()) CounterContext.instance().updateDigest(digest, cell.value); else digest.update(cell.value.duplicate()); FBUtilities.updateWithLong(digest, cell.timestamp); FBUtilities.updateWithByte(digest, cell.serializationFlags()); if (cell.isExpiring()) FBUtilities.updateWithInt(digest, cell.ttl); if (cell.isCounter()) { // Counters used to have the timestampOfLastDelete field, which we stopped using long ago and has been hard-coded // to Long.MIN_VALUE but was still taken into account in 2.2 counter digests (to maintain backward compatibility // in the first place). FBUtilities.updateWithLong(digest, Long.MIN_VALUE); } } if (partitionDeletion.markedForDeleteAt() != Long.MIN_VALUE) digest.update(ByteBufferUtil.bytes(partitionDeletion.markedForDeleteAt())); if (!rangeTombstones.isEmpty()) rangeTombstones.updateDigest(digest); } }
public void digest(CFMetaData metadata, MessageDigest digest) { for (LegacyCell cell : cells) { digest.update(cell.name.encode(metadata).duplicate()); if (cell.isCounter()) CounterContext.instance().updateDigest(digest, cell.value); else digest.update(cell.value.duplicate()); FBUtilities.updateWithLong(digest, cell.timestamp); FBUtilities.updateWithByte(digest, cell.serializationFlags()); if (cell.isExpiring()) FBUtilities.updateWithInt(digest, cell.ttl); if (cell.isCounter()) { // Counters used to have the timestampOfLastDelete field, which we stopped using long ago and has been hard-coded // to Long.MIN_VALUE but was still taken into account in 2.2 counter digests (to maintain backward compatibility // in the first place). FBUtilities.updateWithLong(digest, Long.MIN_VALUE); } } if (partitionDeletion.markedForDeleteAt() != Long.MIN_VALUE) digest.update(ByteBufferUtil.bytes(partitionDeletion.markedForDeleteAt())); if (!rangeTombstones.isEmpty()) rangeTombstones.updateDigest(digest); } }
public void digest(MessageDigest digest) { if (isCounterCell()) { CounterContext.instance().updateDigest(digest, value()); } else { digest.update(value().duplicate()); } FBUtilities.updateWithLong(digest, timestamp()); FBUtilities.updateWithInt(digest, ttl()); FBUtilities.updateWithBoolean(digest, isCounterCell()); if (path() != null) path().digest(digest); }
public void digest(CFMetaData metadata, MessageDigest digest) { for (LegacyCell cell : cells) { digest.update(cell.name.encode(metadata).duplicate()); if (cell.isCounter()) CounterContext.instance().updateDigest(digest, cell.value); else digest.update(cell.value.duplicate()); FBUtilities.updateWithLong(digest, cell.timestamp); FBUtilities.updateWithByte(digest, cell.serializationFlags()); if (cell.isExpiring()) FBUtilities.updateWithInt(digest, cell.ttl); if (cell.isCounter()) { // Counters used to have the timestampOfLastDelete field, which we stopped using long ago and has been hard-coded // to Long.MIN_VALUE but was still taken into account in 2.2 counter digests (to maintain backward compatibility // in the first place). FBUtilities.updateWithLong(digest, Long.MIN_VALUE); } } if (partitionDeletion.markedForDeleteAt() != Long.MIN_VALUE) digest.update(ByteBufferUtil.bytes(partitionDeletion.markedForDeleteAt())); if (!rangeTombstones.isEmpty()) rangeTombstones.updateDigest(digest); } }
public void digest(CFMetaData metadata, MessageDigest digest) { for (LegacyCell cell : cells) { digest.update(cell.name.encode(metadata).duplicate()); if (cell.isCounter()) CounterContext.instance().updateDigest(digest, cell.value); else digest.update(cell.value.duplicate()); FBUtilities.updateWithLong(digest, cell.timestamp); FBUtilities.updateWithByte(digest, cell.serializationFlags()); if (cell.isExpiring()) FBUtilities.updateWithInt(digest, cell.ttl); if (cell.isCounter()) { // Counters used to have the timestampOfLastDelete field, which we stopped using long ago and has been hard-coded // to Long.MIN_VALUE but was still taken into account in 2.2 counter digests (to maintain backward compatibility // in the first place). FBUtilities.updateWithLong(digest, Long.MIN_VALUE); } } if (partitionDeletion.markedForDeleteAt() != Long.MIN_VALUE) digest.update(ByteBufferUtil.bytes(partitionDeletion.markedForDeleteAt())); if (!rangeTombstones.isEmpty()) rangeTombstones.updateDigest(digest); } }
public void digest(MessageDigest digest) { if (isCounterCell()) { CounterContext.instance().updateDigest(digest, value()); } else { digest.update(value().duplicate()); } FBUtilities.updateWithLong(digest, timestamp()); FBUtilities.updateWithInt(digest, ttl()); FBUtilities.updateWithBoolean(digest, isCounterCell()); if (path() != null) path().digest(digest); }
public void digest(MessageDigest digest) { if (isCounterCell()) { CounterContext.instance().updateDigest(digest, value()); } else { digest.update(value().duplicate()); } FBUtilities.updateWithLong(digest, timestamp()); FBUtilities.updateWithInt(digest, ttl()); FBUtilities.updateWithBoolean(digest, isCounterCell()); if (path() != null) path().digest(digest); }