@Test(expected = IllegalArgumentException.class) public void testBadTableName(){ RepoAndTableUtil.getHBaseTableName("myRepo", "invalid__table"); }
public static String getHBaseTableName(String repositoryName, String tableName) { if (! isValidTableName(tableName)) throw new IllegalArgumentException("Bad table name: " + tableName); if (! isValidTableName(repositoryName)) throw new IllegalArgumentException("Bad repository name: " + repositoryName); if (repositoryName.equals(DEFAULT_REPOSITORY)) { return tableName; } else { return repositoryName + REPOSITORY_TABLE_SEPARATOR + tableName; } }
RepoAndTableUtil { public static String getHBaseTableName(String repositoryName, String tableName) { if (! isValidTableName(tableName)) throw new IllegalArgumentException("Bad table name: " + tableName); if (! isValidTableName(repositoryName)) throw new IllegalArgumentException("Bad repository name: " + repositoryName); if (repositoryName.equals(DEFAULT_REPOSITORY)) { return tableName; } else { return repositoryName + REPOSITORY_TABLE_SEPARATOR + tableName; } } }
RepoAndTableUtil { public static String getHBaseTableName(String repositoryName, String tableName) { if (! isValidTableName(tableName)) throw new IllegalArgumentException("Bad table name: " + tableName); if (! isValidTableName(repositoryName)) throw new IllegalArgumentException("Bad repository name: " + repositoryName); if (repositoryName.equals(DEFAULT_REPOSITORY)) { return tableName; } else { return repositoryName + REPOSITORY_TABLE_SEPARATOR + tableName; } }  }
RepoAndTableUtil { public static String getHBaseTableName(String repositoryName, String tableName) { if (! isValidTableName(tableName)) throw new IllegalArgumentException("Bad table name: " + tableName); if (! isValidTableName(repositoryName)) throw new IllegalArgumentException("Bad repository name: " + repositoryName); if (repositoryName.equals(DEFAULT_REPOSITORY)) { return tableName; } else { return repositoryName + REPOSITORY_TABLE_SEPARATOR + tableName; } }  static final boolean belongsToRepository(String hbaseTableName, String repositoryName); static String getHBaseTableName(String repositoryName, String tableName); static boolean isValidTableName(String name); static String extractLilyTableName(String repositoryName, String hbaseTableName); static String[] getRepositoryAndTable(String hbaseTableName); static void setRepositoryOwnership(HTableDescriptor tableDescriptor, String repositoryName); static String getOwningRepository(HTableDescriptor tableDescriptor); }
RepoAndTableUtil { public static String getHBaseTableName(String repositoryName, String tableName) { if (! isValidTableName(tableName)) throw new IllegalArgumentException("Bad table name: " + tableName); if (! isValidTableName(repositoryName)) throw new IllegalArgumentException("Bad repository name: " + repositoryName); if (repositoryName.equals(DEFAULT_REPOSITORY)) { return tableName; } else { return repositoryName + REPOSITORY_TABLE_SEPARATOR + tableName; } }  static final boolean belongsToRepository(String hbaseTableName, String repositoryName); static String getHBaseTableName(String repositoryName, String tableName); static boolean isValidTableName(String name); static String extractLilyTableName(String repositoryName, String hbaseTableName); static String[] getRepositoryAndTable(String hbaseTableName); static void setRepositoryOwnership(HTableDescriptor tableDescriptor, String repositoryName); static String getOwningRepository(HTableDescriptor tableDescriptor); static final String DEFAULT_REPOSITORY; static final String REPOSITORY_TABLE_SEPARATOR; static final String VALID_NAME_EXPLANATION; }