@Test public void testIsAccountContainerMatch() { BlobId blobId = getRandomBlobId(version); if (version == BLOB_ID_V1) { assertTrue("isAccountContainerMatch() should always return true for V1 blobID.", blobId.isAccountContainerMatch(blobId.getAccountId(), blobId.getContainerId())); assertTrue("isAccountContainerMatch() should always return true for V1 blobID.", blobId.isAccountContainerMatch((short) -1, (short) -1)); assertTrue("isAccountContainerMatch() should always return true for V1 blobID.", blobId.isAccountContainerMatch(getRandomShort(random), getRandomShort(random))); } else { assertTrue("isAccountContainerMatch() should return true because account and container match.", blobId.isAccountContainerMatch(blobId.getAccountId(), blobId.getContainerId())); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch(blobId.getAccountId(), (short) -1)); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch(blobId.getAccountId(), getRandomShort(random))); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch((short) -1, blobId.getContainerId())); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch(getRandomShort(random), blobId.getContainerId())); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch((short) -1, (short) -1)); assertFalse("isAccountContainerMatch() should return false because account or container mismatch.", blobId.isAccountContainerMatch(getRandomShort(random), getRandomShort(random))); } }
@Override public boolean isAccountContainerMatch(short accountId, short containerId) { if (getVersion() == BLOB_ID_V1) { return true; } return (this.accountId == accountId) && (this.containerId == containerId); }
BlobId extends StoreKey { @Override public boolean isAccountContainerMatch(short accountId, short containerId) { if (getVersion() == BLOB_ID_V1) { return true; } return (this.accountId == accountId) && (this.containerId == containerId); } }
BlobId extends StoreKey { @Override public boolean isAccountContainerMatch(short accountId, short containerId) { if (getVersion() == BLOB_ID_V1) { return true; } return (this.accountId == accountId) && (this.containerId == containerId); } BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId,
      PartitionId partitionId, boolean isEncrypted, BlobDataType blobDataType);   BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId, PartitionId partitionId,
      boolean isEncrypted, BlobDataType blobDataType, String uuidStr); private  BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead);  BlobId(String id, ClusterMap clusterMap);  BlobId(DataInputStream stream, ClusterMap clusterMap); }
BlobId extends StoreKey { @Override public boolean isAccountContainerMatch(short accountId, short containerId) { if (getVersion() == BLOB_ID_V1) { return true; } return (this.accountId == accountId) && (this.containerId == containerId); } BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId,
      PartitionId partitionId, boolean isEncrypted, BlobDataType blobDataType);   BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId, PartitionId partitionId,
      boolean isEncrypted, BlobDataType blobDataType, String uuidStr); private  BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead);  BlobId(String id, ClusterMap clusterMap);  BlobId(DataInputStream stream, ClusterMap clusterMap); short sizeInBytes(); short getVersion(); PartitionId getPartition(); short getAccountId(); short getContainerId(); @Override boolean isAccountContainerMatch(short accountId, short containerId); byte getDatacenterId(); BlobIdType getType(); BlobDataType getBlobDataType(); static boolean isEncrypted(String blobIdString); String getUuid(); @Override byte[] toBytes(); @Override byte[] getUuidBytesArray(); @Override String getID(); @Override String getLongForm(); @Override String toString(); @Override int compareTo(StoreKey o); @Override boolean equals(Object o); @Override int hashCode(); static Short[] getAllValidVersions(); static BlobId craft(BlobId inputId, short targetVersion, short accountId, short containerId); static boolean isCrafted(String idStr); static short getVersion(String idStr); static Pair<Short, Short> getAccountAndContainerIds(String idStr); static BlobDataType getBlobDataType(String idStr); }
BlobId extends StoreKey { @Override public boolean isAccountContainerMatch(short accountId, short containerId) { if (getVersion() == BLOB_ID_V1) { return true; } return (this.accountId == accountId) && (this.containerId == containerId); } BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId,
      PartitionId partitionId, boolean isEncrypted, BlobDataType blobDataType);   BlobId(short version, BlobIdType type, byte datacenterId, short accountId, short containerId, PartitionId partitionId,
      boolean isEncrypted, BlobDataType blobDataType, String uuidStr); private  BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead);  BlobId(String id, ClusterMap clusterMap);  BlobId(DataInputStream stream, ClusterMap clusterMap); short sizeInBytes(); short getVersion(); PartitionId getPartition(); short getAccountId(); short getContainerId(); @Override boolean isAccountContainerMatch(short accountId, short containerId); byte getDatacenterId(); BlobIdType getType(); BlobDataType getBlobDataType(); static boolean isEncrypted(String blobIdString); String getUuid(); @Override byte[] toBytes(); @Override byte[] getUuidBytesArray(); @Override String getID(); @Override String getLongForm(); @Override String toString(); @Override int compareTo(StoreKey o); @Override boolean equals(Object o); @Override int hashCode(); static Short[] getAllValidVersions(); static BlobId craft(BlobId inputId, short targetVersion, short accountId, short containerId); static boolean isCrafted(String idStr); static short getVersion(String idStr); static Pair<Short, Short> getAccountAndContainerIds(String idStr); static BlobDataType getBlobDataType(String idStr); static final short BLOB_ID_V1; static final short BLOB_ID_V2; static final short BLOB_ID_V3; static final short BLOB_ID_V4; static final short BLOB_ID_V5; static final short BLOB_ID_V6; }