valepakh commented on code in PR #3923:
URL: https://github.com/apache/ignite-3/pull/3923#discussion_r1642719621


##########
modules/core/src/main/java/org/apache/ignite/internal/compute/JobStatusImpl.java:
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.compute;
+
+import java.time.Instant;
+import java.util.Objects;
+import java.util.UUID;
+import org.apache.ignite.compute.JobState;
+import org.apache.ignite.compute.JobStatus;
+import org.apache.ignite.internal.tostring.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Job status.
+ */
+public class JobStatusImpl implements JobStatus {
+    private static final long serialVersionUID = 8575969461073736006L;
+
+    /**
+     * Job ID.
+     */
+    private final UUID id;
+
+    /**
+     * Job state.
+     */
+    private final JobState state;
+
+    /**
+     * Job create time.
+     */
+    private final Instant createTime;
+
+    /**
+     * Job start time.
+     */
+    @Nullable
+    private final Instant startTime;
+
+    /**
+     * Job finish time.
+     */
+    @Nullable
+    private final Instant finishTime;
+
+    private JobStatusImpl(Builder builder) {
+        this.id = Objects.requireNonNull(builder.id, "id");
+        this.state = Objects.requireNonNull(builder.state, "state");
+        this.createTime = Objects.requireNonNull(builder.createTime, 
"createTime");
+        this.startTime = builder.startTime;
+        this.finishTime = builder.finishTime;
+    }
+
+    /**
+     * Creates a new builder.
+     *
+     * @return Builder.
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Returns job ID.
+     *
+     * @return Job ID.
+     */
+    @Override
+    public UUID id() {
+        return id;
+    }
+
+    /**
+     * Returns job state.
+     *
+     * @return Job state.
+     */
+    @Override
+    public JobState state() {
+        return state;
+    }
+
+    /**
+     * Returns job create time.
+     *
+     * @return Job create time.
+     */
+    @Override
+    public Instant createTime() {
+        return createTime;
+    }
+
+    /**
+     * Returns job start time. {@code null} if the job has not started yet.
+     *
+     * @return Job start time. {@code null} if the job has not started yet.
+     */
+    @Nullable
+    @Override
+    public Instant startTime() {
+        return startTime;
+    }
+
+    /**
+     * Returns job finish time. {@code null} if the job has not finished yet.
+     *
+     * @return Job finish time. {@code null} if the job has not finished yet.
+     */
+    @Nullable
+    @Override
+    public Instant finishTime() {
+        return finishTime;
+    }
+
+    /**
+     * Returns a new builder with the same property values as this JobStatus.
+     *
+     * @return Builder.
+     */
+    public static Builder toBuilder(JobStatus status) {
+        return new Builder(status);
+    }
+
+    @Override
+    public String toString() {
+        return S.toString(this);
+    }
+
+    /**
+     * Builder.
+     */
+    public static class Builder {
+        private UUID id;
+        private JobState state;
+        private Instant createTime;
+        @Nullable
+        private Instant startTime;
+        @Nullable
+        private Instant finishTime;
+
+        /**
+         * Constructor.
+         */
+        public Builder() {
+        }
+
+        /**
+         * Constructor.
+         *
+         * @param status Job status for copy.
+         */
+        public Builder(JobStatus status) {

Review Comment:
   ```suggestion
           private Builder(JobStatus status) {
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/compute/JobStatusImpl.java:
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.compute;
+
+import java.time.Instant;
+import java.util.Objects;
+import java.util.UUID;
+import org.apache.ignite.compute.JobState;
+import org.apache.ignite.compute.JobStatus;
+import org.apache.ignite.internal.tostring.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Job status.
+ */
+public class JobStatusImpl implements JobStatus {
+    private static final long serialVersionUID = 8575969461073736006L;
+
+    /**
+     * Job ID.
+     */
+    private final UUID id;
+
+    /**
+     * Job state.
+     */
+    private final JobState state;
+
+    /**
+     * Job create time.
+     */
+    private final Instant createTime;
+
+    /**
+     * Job start time.
+     */
+    @Nullable
+    private final Instant startTime;
+
+    /**
+     * Job finish time.
+     */
+    @Nullable
+    private final Instant finishTime;
+
+    private JobStatusImpl(Builder builder) {
+        this.id = Objects.requireNonNull(builder.id, "id");
+        this.state = Objects.requireNonNull(builder.state, "state");
+        this.createTime = Objects.requireNonNull(builder.createTime, 
"createTime");
+        this.startTime = builder.startTime;
+        this.finishTime = builder.finishTime;
+    }
+
+    /**
+     * Creates a new builder.
+     *
+     * @return Builder.
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Returns job ID.
+     *
+     * @return Job ID.
+     */
+    @Override
+    public UUID id() {
+        return id;
+    }
+
+    /**
+     * Returns job state.
+     *
+     * @return Job state.
+     */
+    @Override
+    public JobState state() {
+        return state;
+    }
+
+    /**
+     * Returns job create time.
+     *
+     * @return Job create time.
+     */
+    @Override
+    public Instant createTime() {
+        return createTime;
+    }
+
+    /**
+     * Returns job start time. {@code null} if the job has not started yet.
+     *
+     * @return Job start time. {@code null} if the job has not started yet.
+     */
+    @Nullable
+    @Override
+    public Instant startTime() {
+        return startTime;
+    }
+
+    /**
+     * Returns job finish time. {@code null} if the job has not finished yet.
+     *
+     * @return Job finish time. {@code null} if the job has not finished yet.
+     */
+    @Nullable
+    @Override
+    public Instant finishTime() {
+        return finishTime;
+    }
+
+    /**
+     * Returns a new builder with the same property values as this JobStatus.
+     *
+     * @return Builder.
+     */
+    public static Builder toBuilder(JobStatus status) {
+        return new Builder(status);
+    }
+
+    @Override
+    public String toString() {
+        return S.toString(this);
+    }
+
+    /**
+     * Builder.
+     */
+    public static class Builder {
+        private UUID id;
+        private JobState state;
+        private Instant createTime;
+        @Nullable
+        private Instant startTime;
+        @Nullable
+        private Instant finishTime;
+
+        /**
+         * Constructor.
+         */
+        public Builder() {

Review Comment:
   ```suggestion
           private Builder() {
   ```



-- 
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]

Reply via email to