|
31 | 31 | import org.apache.accumulo.core.conf.Property;
|
32 | 32 | import org.apache.accumulo.core.dataImpl.KeyExtent;
|
33 | 33 | import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
|
| 34 | +import org.apache.accumulo.core.metadata.schema.ExternalCompactionFinalState; |
34 | 35 | import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
|
35 | 36 | import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
|
36 | 37 | import org.apache.accumulo.core.util.compaction.ExternalCompactionUtil;
|
@@ -106,15 +107,18 @@ private void detectDeadCompactions() {
|
106 | 107 | });
|
107 | 108 |
|
108 | 109 | // Determine which compactions are currently committing and remove those
|
109 |
| - context.getAmple().getExternalCompactionFinalStates() |
110 |
| - .map(ecfs -> ecfs.getExternalCompactionId()).forEach(ecid -> { |
111 |
| - if (tabletCompactions.remove(ecid) != null) { |
112 |
| - log.trace("Removed compaction {} that is committing", ecid); |
113 |
| - } |
114 |
| - if (this.deadCompactions.remove(ecid) != null) { |
115 |
| - log.trace("Removed {} from the dead compaction map, it's committing", ecid); |
116 |
| - } |
117 |
| - }); |
| 110 | + try ( |
| 111 | + var externalCompactionFinalStates = context.getAmple().getExternalCompactionFinalStates()) { |
| 112 | + externalCompactionFinalStates.map(ExternalCompactionFinalState::getExternalCompactionId) |
| 113 | + .forEach(ecid -> { |
| 114 | + if (tabletCompactions.remove(ecid) != null) { |
| 115 | + log.trace("Removed compaction {} that is committing", ecid); |
| 116 | + } |
| 117 | + if (this.deadCompactions.remove(ecid) != null) { |
| 118 | + log.trace("Removed {} from the dead compaction map, it's committing", ecid); |
| 119 | + } |
| 120 | + }); |
| 121 | + } |
118 | 122 |
|
119 | 123 | tabletCompactions.forEach((ecid, extent) -> {
|
120 | 124 | var count = this.deadCompactions.merge(ecid, 1L, Long::sum);
|
|
0 commit comments