Skip to content

Commit

Permalink
Remove useless codes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed May 25, 2024
1 parent 321c5f6 commit 8e959eb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,4 @@
* Attach available.
*/
public interface Attachable {

/**
* Get start index.
*
* @return start index
*/
int getStartIndex();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

public enum ACLAttributeEnum {

UNCHANGED, DEFAULT, YES, NO
DEFAULT, YES, NO
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

public enum ACLAttributeEnum {

UNCHANGED, DEFAULT, YES, NO
DEFAULT, YES, NO
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public abstract class AbstractDatabaseMetaDataExecutor implements DatabaseAdminQ
public final void execute(final ConnectionSession connectionSession) throws SQLException {
Collection<String> databaseNames = getDatabaseNames(connectionSession);
for (String databaseName : databaseNames) {
initDatabaseData(databaseName);
processMetaData(databaseName, resultSet -> handleResultSet(databaseName, resultSet));
}
postProcess();
Expand All @@ -82,9 +81,10 @@ public final void execute(final ConnectionSession connectionSession) throws SQLE
private void handleResultSet(final String databaseName, final ResultSet resultSet) {
ResultSetMetaData metaData = resultSet.getMetaData();
while (resultSet.next()) {
Map<String, Object> rowMap = new LinkedHashMap<>();
Map<String, String> aliasMap = new LinkedHashMap<>();
for (int i = 1; i < metaData.getColumnCount() + 1; i++) {
int columnCount = metaData.getColumnCount();
Map<String, Object> rowMap = new LinkedHashMap<>(columnCount, 1F);
Map<String, String> aliasMap = new LinkedHashMap<>(columnCount, 1F);
for (int i = 1; i < columnCount + 1; i++) {
aliasMap.put(metaData.getColumnName(i), metaData.getColumnLabel(i));
rowMap.put(metaData.getColumnLabel(i), resultSet.getString(i));
}
Expand All @@ -100,8 +100,6 @@ private void handleResultSet(final String databaseName, final ResultSet resultSe
}
}

protected abstract void initDatabaseData(String databaseName);

protected abstract Collection<String> getDatabaseNames(ConnectionSession connectionSession);

protected abstract void preProcess(String databaseName, Map<String, Object> rows, Map<String, String> alias);
Expand Down Expand Up @@ -144,10 +142,6 @@ public static class DefaultDatabaseMetaDataExecutor extends AbstractDatabaseMeta

private final List<Object> parameters;

@Override
protected void initDatabaseData(final String databaseName) {
}

@Override
protected Collection<String> getDatabaseNames(final ConnectionSession connectionSession) {
Optional<String> database = ProxyContext.getInstance().getAllDatabaseNames().stream().filter(each -> isAuthorized(each, connectionSession.getGrantee()))
Expand Down

0 comments on commit 8e959eb

Please sign in to comment.