Skip to content

Commit 019f5d3

Browse files
committed
HDDS-1228. Fix checkstyle/findbugs/rat, move comparator to impl package
1 parent ffca89b commit 019f5d3

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerData.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,10 @@ public void setDataScanTimestamp(Long timestamp) {
541541
: Optional.empty();
542542
}
543543

544+
public Long getDataScanTimestamp() {
545+
return dataScanTimestamp;
546+
}
547+
544548
/**
545549
* Returns the origin pipeline Id of this container.
546550
* @return origin node Id

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerDataScanOrder.java renamed to hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerDataScanOrder.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
package org.apache.hadoop.ozone.container.common.interfaces;
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.ozone.container.common.impl;
219

3-
import org.apache.hadoop.ozone.container.common.impl.ContainerData;
20+
import org.apache.hadoop.ozone.container.common.interfaces.Container;
421

522
import java.time.Instant;
623
import java.util.Comparator;

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.apache.hadoop.hdds.scm.container.common.helpers
2828
.StorageContainerException;
2929
import org.apache.hadoop.ozone.container.common.interfaces.Container;
30-
import org.apache.hadoop.ozone.container.common.interfaces.ContainerDataScanOrder;
3130
import org.apache.hadoop.ozone.container.common.volume.HddsVolume;
3231
import org.slf4j.Logger;
3332
import org.slf4j.LoggerFactory;

hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDataYaml.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.util.UUID;
3434

3535
import static org.junit.Assert.assertEquals;
36-
import static org.junit.Assert.assertNotNull;
3736
import static org.junit.Assert.assertTrue;
3837
import static org.junit.Assert.fail;
3938

@@ -105,6 +104,8 @@ public void testCreateContainerFile() throws IOException {
105104
assertEquals(MAXSIZE, kvData.getMaxSize());
106105
assertTrue(kvData.lastDataScanTime().isPresent());
107106
assertEquals(SCAN_TIME, kvData.lastDataScanTime().get());
107+
assertEquals(SCAN_TIME.toEpochMilli(),
108+
kvData.getDataScanTimestamp().longValue());
108109

109110
// Update ContainerData.
110111
kvData.addMetadata("VOLUME", "hdfs");
@@ -135,6 +136,8 @@ public void testCreateContainerFile() throws IOException {
135136
assertEquals(MAXSIZE, kvData.getMaxSize());
136137
assertTrue(kvData.lastDataScanTime().isPresent());
137138
assertEquals(SCAN_TIME, kvData.lastDataScanTime().get());
139+
assertEquals(SCAN_TIME.toEpochMilli(),
140+
kvData.getDataScanTimestamp().longValue());
138141
}
139142

140143
@Test

0 commit comments

Comments
 (0)