@Test(expected=IllegalArgumentException.class) public void getNameWithInvalidId() { uid = new UniqueId(client, table, kind, 3); uid.getName(new byte[] { 1 }); }
public String getName(final byte[] id) throws NoSuchUniqueId, HBaseException { if (id.length != idWidth) { throw new IllegalArgumentException("Wrong id.length = " + id.length + " which is != " + idWidth + " required for '" + kind() + '\''); } String name = getNameFromCache(id); if (name != null) { cacheHits++; } else { cacheMisses++; name = getNameFromHBase(id); if (name == null) { throw new NoSuchUniqueId(kind(), id); } addNameToCache(id, name); addIdToCache(name, id); } return name; }
UniqueId implements UniqueIdInterface { public String getName(final byte[] id) throws NoSuchUniqueId, HBaseException { if (id.length != idWidth) { throw new IllegalArgumentException("Wrong id.length = " + id.length + " which is != " + idWidth + " required for '" + kind() + '\''); } String name = getNameFromCache(id); if (name != null) { cacheHits++; } else { cacheMisses++; name = getNameFromHBase(id); if (name == null) { throw new NoSuchUniqueId(kind(), id); } addNameToCache(id, name); addIdToCache(name, id); } return name; } }
UniqueId implements UniqueIdInterface { public String getName(final byte[] id) throws NoSuchUniqueId, HBaseException { if (id.length != idWidth) { throw new IllegalArgumentException("Wrong id.length = " + id.length + " which is != " + idWidth + " required for '" + kind() + '\''); } String name = getNameFromCache(id); if (name != null) { cacheHits++; } else { cacheMisses++; name = getNameFromHBase(id); if (name == null) { throw new NoSuchUniqueId(kind(), id); } addNameToCache(id, name); addIdToCache(name, id); } return name; } UniqueId(final HBaseClient client, final byte[] table, final String kind,
                    final int width); }
UniqueId implements UniqueIdInterface { public String getName(final byte[] id) throws NoSuchUniqueId, HBaseException { if (id.length != idWidth) { throw new IllegalArgumentException("Wrong id.length = " + id.length + " which is != " + idWidth + " required for '" + kind() + '\''); } String name = getNameFromCache(id); if (name != null) { cacheHits++; } else { cacheMisses++; name = getNameFromHBase(id); if (name == null) { throw new NoSuchUniqueId(kind(), id); } addNameToCache(id, name); addIdToCache(name, id); } return name; } UniqueId(final HBaseClient client, final byte[] table, final String kind,
                    final int width); int cacheHits(); int cacheMisses(); int cacheSize(); String kind(); short width(); void dropCaches(); String getName(final byte[] id); byte[] getId(final String name); byte[] getOrCreateId(String name); List<String> suggest(final String search); void rename(final String oldname, final String newname); String toString(); }
UniqueId implements UniqueIdInterface { public String getName(final byte[] id) throws NoSuchUniqueId, HBaseException { if (id.length != idWidth) { throw new IllegalArgumentException("Wrong id.length = " + id.length + " which is != " + idWidth + " required for '" + kind() + '\''); } String name = getNameFromCache(id); if (name != null) { cacheHits++; } else { cacheMisses++; name = getNameFromHBase(id); if (name == null) { throw new NoSuchUniqueId(kind(), id); } addNameToCache(id, name); addIdToCache(name, id); } return name; } UniqueId(final HBaseClient client, final byte[] table, final String kind,
                    final int width); int cacheHits(); int cacheMisses(); int cacheSize(); String kind(); short width(); void dropCaches(); String getName(final byte[] id); byte[] getId(final String name); byte[] getOrCreateId(String name); List<String> suggest(final String search); void rename(final String oldname, final String newname); String toString();  }