1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing, software13 * 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 and16 * limitations under the License.17 */1819package org.apache.giraph.master;
2021import com.facebook.swift.codec.ThriftField;
22import com.facebook.swift.codec.ThriftStruct;
2324/**25 * Stores information about master progress26 */27 @ThriftStruct
28publicfinalclassMasterProgress {
29/** Singleton instance for everyone to use */30privatestaticfinalMasterProgress INSTANCE = newMasterProgress();
3132/** How many vertex input splits were created */33privateint vertexInputSplitCount = -1;
34/** How many edge input splits were created */35privateint edgeInputSplitCount = -1;
3637/**38 * Public constructor for thrift to create us.39 * Please use MasterProgress.get() to get the static instance.40 */41publicMasterProgress() {
42 }
4344/**45 * Get singleton instance of MasterProgress.46 *47 * @return MasterProgress singleton instance48 */49publicstaticMasterProgress get() {
50return INSTANCE;
51 }
5253 @ThriftField(1)
54publicint getVertexInputSplitCount() {
55return vertexInputSplitCount;
56 }
5758 @ThriftField
59publicvoid setVertexInputSplitCount(int vertexInputSplitCount) {
60this.vertexInputSplitCount = vertexInputSplitCount;
61 }
6263 @ThriftField(2)
64publicint getEdgeInputSplitsCount() {
65return edgeInputSplitCount;
66 }
6768 @ThriftField
69publicvoid setEdgeInputSplitsCount(int edgeInputSplitCount) {
70this.edgeInputSplitCount = edgeInputSplitCount;
71 }
7273/**74 * Whether or not number of vertex input splits was set yet75 *76 * @return True iff it was set77 */78publicboolean vertexInputSplitsSet() {
79return vertexInputSplitCount != -1;
80 }
8182/**83 * Whether or not number of edge input splits was set yet84 *85 * @return True iff it was set86 */87publicboolean edgeInputSplitsSet() {
88return edgeInputSplitCount != -1;
89 }
90 }