Skip to content

Commit 6caf25e

Browse files
silly mistake
1 parent 80dd227 commit 6caf25e

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,21 @@ Multimap<TableName, String> getSnapshotsToComputeSize() throws IOException {
166166
Set<TableName> tablesToFetchSnapshotsFrom = new HashSet<>();
167167
QuotaFilter filter = new QuotaFilter();
168168
filter.addTypeFilter(QuotaType.SPACE);
169-
try (Admin admin = conn.getAdmin()) {
169+
try (Admin admin = conn.getAdmin(); QuotaRetriever qr = new QuotaRetriever(conn, filter)) {
170170
// Pull all of the tables that have quotas (direct, or from namespace)
171-
try (QuotaRetriever qr = new QuotaRetriever(conn, filter)) {
172-
for (QuotaSettings qs : qr) {
173-
if (qs.getQuotaType() == QuotaType.SPACE) {
174-
String ns = qs.getNamespace();
175-
TableName tn = qs.getTableName();
176-
if ((null == ns && null == tn) || (null != ns && null != tn)) {
177-
throw new IllegalStateException(
178-
"Expected either one of namespace and tablename to be null but not both");
179-
}
180-
// Collect either the table name itself, or all of the tables in the namespace
181-
if (null != ns) {
182-
tablesToFetchSnapshotsFrom.addAll(Arrays.asList(admin.listTableNamesByNamespace(ns)));
183-
} else {
184-
tablesToFetchSnapshotsFrom.add(tn);
185-
}
171+
for (QuotaSettings qs : qr) {
172+
if (qs.getQuotaType() == QuotaType.SPACE) {
173+
String ns = qs.getNamespace();
174+
TableName tn = qs.getTableName();
175+
if ((null == ns && null == tn) || (null != ns && null != tn)) {
176+
throw new IllegalStateException(
177+
"Expected either one of namespace and tablename to be null but not both");
178+
}
179+
// Collect either the table name itself, or all of the tables in the namespace
180+
if (null != ns) {
181+
tablesToFetchSnapshotsFrom.addAll(Arrays.asList(admin.listTableNamesByNamespace(ns)));
182+
} else {
183+
tablesToFetchSnapshotsFrom.add(tn);
186184
}
187185
}
188186
}

0 commit comments

Comments
 (0)