timoninmaxim commented on code in PR #10820:
URL: https://github.com/apache/ignite/pull/10820#discussion_r1250843829
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -464,6 +465,9 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
private final boolean sequentialWrite =
IgniteSystemProperties.getBoolean(IGNITE_SNAPSHOT_SEQUENTIAL_WRITE,
DFLT_IGNITE_SNAPSHOT_SEQUENTIAL_WRITE);
+ /** Status of snapshot check operations. */
+ private final List<CheckOperationStatus> checkOpsStatus = new
CopyOnWriteArrayList<>();
Review Comment:
`ConcurrentHashMap.newKeySet()`?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -4611,6 +4630,61 @@ public
IgniteSnapshotFutureImpl(IgniteInternalFuture<Void> fut) {
}
}
+ /** Snapshot check operation status. */
+ public class CheckOperationStatus implements AutoCloseable {
+ /** Snapshot metadata. */
+ private final SnapshotMetadata meta;
+
+ /** Operation request ID. */
+ private final UUID reqId;
+
+ /** Start time. */
+ private final long startTime = U.currentTimeMillis();
+
+ /** Processed partitions. */
+ private final AtomicInteger processedParts = new AtomicInteger();
+
+ /** Total partitions. */
+ private final Integer totalParts;
+
+ /** */
+ CheckOperationStatus(SnapshotMetadata meta, Integer totalParts, UUID
reqId) {
+ this.meta = meta;
+ this.totalParts = totalParts;
+ this.reqId = reqId;
+ }
+
+ /** @return Snapshot metadata. */
+ public SnapshotMetadata metadata() {
+ return meta;
+ }
+
+ /** @return Operation request ID. */
+ public UUID requestId() {
+ return reqId;
+ }
+
+ /** @return Start time. */
+ public long startTime() {
+ return startTime;
+ }
+
+ /** @return Processed partitions. */
+ public AtomicInteger processedPartitions() {
Review Comment:
It should return `int`. Internal fields must not be exposed for
modification. Let's add modification method instead.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -4611,6 +4630,61 @@ public
IgniteSnapshotFutureImpl(IgniteInternalFuture<Void> fut) {
}
}
+ /** Snapshot check operation status. */
+ public class CheckOperationStatus implements AutoCloseable {
+ /** Snapshot metadata. */
+ private final SnapshotMetadata meta;
+
+ /** Operation request ID. */
+ private final UUID reqId;
+
+ /** Start time. */
+ private final long startTime = U.currentTimeMillis();
+
+ /** Processed partitions. */
+ private final AtomicInteger processedParts = new AtomicInteger();
+
+ /** Total partitions. */
+ private final Integer totalParts;
Review Comment:
int?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -4611,6 +4630,61 @@ public
IgniteSnapshotFutureImpl(IgniteInternalFuture<Void> fut) {
}
}
+ /** Snapshot check operation status. */
+ public class CheckOperationStatus implements AutoCloseable {
Review Comment:
Public nested class. Let's create a separate file for it
##########
modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotStatusCommand.java:
##########
@@ -68,23 +70,36 @@ public class SnapshotStatusCommand extends
AbstractSnapshotCommand<NoArg> {
throw new IgniteException(e);
}
- if (res == null) {
- printer.accept("There is no create or restore snapshot operation
in progress.");
Review Comment:
I'm afraid we must not change this output. Logs are part of public API, and
this can be used by users for any scripts. For example, user could have a
script for validate that there is no operations in progress before starting a
snapshot creation. This script might use `grep` for this line. Now this script
starts failing.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotHandlerContext.java:
##########
@@ -44,6 +45,9 @@ public class SnapshotHandlerContext {
/** If {@code true} check snapshot integrity. */
private final boolean check;
+ /** Request ID. */
+ private final UUID reqId;
Review Comment:
Do we actually need `requestId`? It looks like that user doesn't get this ID
in log for check operations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]