@Test public void identitySequenceNameConflict() { AkibanInformationSchema ais = new AkibanInformationSchema(); Sequence.create(ais, "test", "t_s_seq", 1, 1, 1, 10, false); assertEquals(new TableName("test", "t_s_seq$1"), generator.generateIdentitySequenceName(ais, new TableName("test", "t"), "s")); }
@Override public synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column) { String proposed = String.format(IDENTITY_SEQUENCE_FORMAT, table.getTableName(), column); return findUnique(ais.getSequences().keySet(), new TableName(table.getSchemaName(), proposed)); }
DefaultNameGenerator implements NameGenerator { @Override public synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column) { String proposed = String.format(IDENTITY_SEQUENCE_FORMAT, table.getTableName(), column); return findUnique(ais.getSequences().keySet(), new TableName(table.getSchemaName(), proposed)); } }
DefaultNameGenerator implements NameGenerator { @Override public synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column) { String proposed = String.format(IDENTITY_SEQUENCE_FORMAT, table.getTableName(), column); return findUnique(ais.getSequences().keySet(), new TableName(table.getSchemaName(), proposed)); } DefaultNameGenerator();  DefaultNameGenerator(AkibanInformationSchema ais); }
DefaultNameGenerator implements NameGenerator { @Override public synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column) { String proposed = String.format(IDENTITY_SEQUENCE_FORMAT, table.getTableName(), column); return findUnique(ais.getSequences().keySet(), new TableName(table.getSchemaName(), proposed)); } DefaultNameGenerator();  DefaultNameGenerator(AkibanInformationSchema ais); @Override synchronized int generateTableID(TableName name); @Override synchronized int generateIndexID(int rootTableID); @Override synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, String[] pkColNames, String [] fkColNames); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, List<JoinColumn> columns); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, List<String> pkColNames, List<String> fkColNames); @Override synchronized String generateFullTextIndexPath(FullTextIndex index); @Override synchronized TableName generateFKConstraintName(String schemaName, String tableName); @Override synchronized TableName generatePKConstraintName( String schemaName, String tableName); @Override synchronized TableName generateUniqueConstraintName( String schemaName, String tableName); @Override synchronized void mergeAIS(AkibanInformationSchema ais); @Override synchronized void removeTableID(int tableID); @Override synchronized Set<String> getStorageNames(); static Map<Integer,Integer> collectMaxIndexIDs(AkibanInformationSchema ais); static String findUnique(Collection<String> set, String original, int maxLength); static String makeUnique(Collection<String> treeNames, String proposed, int maxLength); static String schemaNameForIndex(Index index); }
DefaultNameGenerator implements NameGenerator { @Override public synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column) { String proposed = String.format(IDENTITY_SEQUENCE_FORMAT, table.getTableName(), column); return findUnique(ais.getSequences().keySet(), new TableName(table.getSchemaName(), proposed)); } DefaultNameGenerator();  DefaultNameGenerator(AkibanInformationSchema ais); @Override synchronized int generateTableID(TableName name); @Override synchronized int generateIndexID(int rootTableID); @Override synchronized TableName generateIdentitySequenceName(AkibanInformationSchema ais, TableName table, String column); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, String[] pkColNames, String [] fkColNames); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, List<JoinColumn> columns); @Override synchronized String generateJoinName(TableName parentTable, TableName childTable, List<String> pkColNames, List<String> fkColNames); @Override synchronized String generateFullTextIndexPath(FullTextIndex index); @Override synchronized TableName generateFKConstraintName(String schemaName, String tableName); @Override synchronized TableName generatePKConstraintName( String schemaName, String tableName); @Override synchronized TableName generateUniqueConstraintName( String schemaName, String tableName); @Override synchronized void mergeAIS(AkibanInformationSchema ais); @Override synchronized void removeTableID(int tableID); @Override synchronized Set<String> getStorageNames(); static Map<Integer,Integer> collectMaxIndexIDs(AkibanInformationSchema ais); static String findUnique(Collection<String> set, String original, int maxLength); static String makeUnique(Collection<String> treeNames, String proposed, int maxLength); static String schemaNameForIndex(Index index); static final int MAX_IDENT; }