Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ public class ContainerSet implements Iterable<Container<?>> {

private static final Logger LOG = LoggerFactory.getLogger(ContainerSet.class);

public static ContainerSet newReadOnlyContainerSet(long recoveringTimeout) {
return new ContainerSet(null, recoveringTimeout);
}

public static ContainerSet newRwContainerSet(Table<ContainerID, String> containerIdsTable, long recoveringTimeout) {
Objects.requireNonNull(containerIdsTable, "containerIdsTable == null");
return new ContainerSet(containerIdsTable, recoveringTimeout);
}

private final ConcurrentSkipListMap<Long, Container<?>> containerMap = new
ConcurrentSkipListMap<>();
private final ConcurrentSkipListSet<Long> missingContainerSet =
Expand All @@ -77,6 +68,15 @@ public static ContainerSet newRwContainerSet(Table<ContainerID, String> containe
private long recoveringTimeout;
private final Table<ContainerID, String> containerIdsTable;

public static ContainerSet newReadOnlyContainerSet(long recoveringTimeout) {
return new ContainerSet(null, recoveringTimeout);
}

public static ContainerSet newRwContainerSet(Table<ContainerID, String> containerIdsTable, long recoveringTimeout) {
Objects.requireNonNull(containerIdsTable, "containerIdsTable == null");
return new ContainerSet(containerIdsTable, recoveringTimeout);
}

private ContainerSet(Table<ContainerID, String> continerIdsTable, long recoveringTimeout) {
this(continerIdsTable, recoveringTimeout, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
*/
public final class CoderUtil {

private static byte[] emptyChunk = new byte[4096];

private CoderUtil() {
// No called
// Not called
}

private static byte[] emptyChunk = new byte[4096];

/**
* Make sure to return an empty chunk buffer for the desired length.
* @param leastLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
@InterfaceAudience.Private
public final class GF256 {

private GF256() { }

private static final byte[] GF_BASE = new byte[]{
(byte) 0x01, (byte) 0x02, (byte) 0x04, (byte) 0x08, (byte) 0x10,
(byte) 0x20, (byte) 0x40, (byte) 0x80, (byte) 0x1d, (byte) 0x3a,
Expand Down Expand Up @@ -153,6 +151,9 @@ private GF256() { }
}
}

private GF256() {
}

/**
* Get the big GF multiply table so utilize it efficiently.
* @return the big GF multiply table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
*/
@InterfaceAudience.Private
public final class RSUtil {

private RSUtil() {
}

// We always use the byte system (with symbol size 8, field size 256,
// primitive polynomial 285, and primitive root 2).
public static final GaloisField GF = GaloisField.getInstance();
public static final int PRIMITIVE_ROOT = 2;

private RSUtil() {
}

public static int[] getPrimitivePower(int numDataUnits, int numParityUnits) {
int[] primitivePower = new int[numDataUnits + numParityUnits];
// compute powers of the primitive root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ public class ManagedRocksObjectMetrics {
private static final String SOURCE_NAME =
ManagedRocksObjectMetrics.class.getSimpleName();

private static ManagedRocksObjectMetrics create() {
return DefaultMetricsSystem.instance().register(SOURCE_NAME,
"OzoneManager DoubleBuffer Metrics",
new ManagedRocksObjectMetrics());
}

@Metric(about = "Total number of managed RocksObjects that are not " +
"closed before being GCed.")
private MutableCounterLong totalLeakObjects;
Expand Down Expand Up @@ -74,4 +68,10 @@ long totalLeakObjects() {
long totalManagedObjects() {
return totalManagedObjects.value();
}

private static ManagedRocksObjectMetrics create() {
return DefaultMetricsSystem.instance().register(SOURCE_NAME,
"OzoneManager DoubleBuffer Metrics",
new ManagedRocksObjectMetrics());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* Utilities to help assert RocksObject closures.
*/
public final class ManagedRocksObjectUtils {
private ManagedRocksObjectUtils() {
}

static final Logger LOG =
LoggerFactory.getLogger(ManagedRocksObjectUtils.class);
Expand All @@ -44,6 +42,9 @@ private ManagedRocksObjectUtils() {

private static final LeakDetector LEAK_DETECTOR = new LeakDetector("ManagedRocksObject");

private ManagedRocksObjectUtils() {
}

static UncheckedAutoCloseable track(AutoCloseable object) {
ManagedRocksObjectMetrics.INSTANCE.increaseManagedObject();
final Class<?> clazz = object.getClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
*/
public class ManagedRawSSTFileReader<T> implements Closeable {

private static final Logger LOG = LoggerFactory.getLogger(ManagedRawSSTFileReader.class);

private final String fileName;
// Native address of pointer to the object.
private final long nativeHandle;

public static boolean tryLoadLibrary() {
try {
loadLibrary();
Expand All @@ -50,11 +56,6 @@ public static boolean loadLibrary() throws NativeLibraryNotLoadedException {
return true;
}

private final String fileName;
// Native address of pointer to the object.
private final long nativeHandle;
private static final Logger LOG = LoggerFactory.getLogger(ManagedRawSSTFileReader.class);

public ManagedRawSSTFileReader(final ManagedOptions options, final String fileName, final int readAheadSize) {
this.fileName = fileName;
this.nativeHandle = this.newRawSSTFileReader(options.getNativeHandle(), fileName, readAheadSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

public class DecommissionStatusSubCommand extends ScmSubcommand {

private String errorMessage = "Error getting pipeline and container metrics for ";

@CommandLine.Option(names = { "--id" },
description = "Show info by datanode UUID",
defaultValue = "")
Expand Down Expand Up @@ -122,8 +124,6 @@ public void execute(ScmClient scmClient) throws IOException {
}
}

private String errorMessage = "Error getting pipeline and container metrics for ";

public String getErrorMessage() {
return errorMessage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,6 @@ public class UsageInfoSubcommand extends ScmSubcommand {
@CommandLine.ArgGroup(multiplicity = "1")
private ExclusiveArguments exclusiveArguments;

private static class ExclusiveArguments {
@CommandLine.Option(names = {"--address"}, paramLabel = "ADDRESS",
description = "Show info by datanode ip or hostname address.",
defaultValue = "")
private String address;

@CommandLine.Option(names = {"--uuid"}, paramLabel = "UUID", description =
"Show info by datanode UUID.", defaultValue = "")
private String uuid;

@CommandLine.Option(names = {"-m", "--most-used"},
description = "Show the most used datanodes.",
defaultValue = "false")
private boolean mostUsed;

@CommandLine.Option(names = {"-l", "--least-used"},
description = "Show the least used datanodes.",
defaultValue = "false")
private boolean leastUsed;
}

@CommandLine.Option(names = {"-c", "--count"}, description = "Number of " +
"datanodes to display (Default: ${DEFAULT-VALUE}).",
paramLabel = "NUMBER OF NODES", defaultValue = "3")
Expand Down Expand Up @@ -288,4 +267,25 @@ public long getPipelineCount() {
return pipelineCount;
}
}

private static class ExclusiveArguments {
@CommandLine.Option(names = {"--address"}, paramLabel = "ADDRESS",
description = "Show info by datanode ip or hostname address.",
defaultValue = "")
private String address;

@CommandLine.Option(names = {"--uuid"}, paramLabel = "UUID", description =
"Show info by datanode UUID.", defaultValue = "")
private String uuid;

@CommandLine.Option(names = {"-m", "--most-used"},
description = "Show the most used datanodes.",
defaultValue = "false")
private boolean mostUsed;

@CommandLine.Option(names = {"-l", "--least-used"},
description = "Show the least used datanodes.",
defaultValue = "false")
private boolean leastUsed;
}
}