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*/18 19packageorg.apache.giraph.worker; 20 21importjavax.annotation.concurrent.NotThreadSafe; 22 23/**24* Stats about a worker's progress25*/26 @NotThreadSafe 27publicclassWorkerProgressStats { 28/**Superstep which worker is executing, Long.MAX_VALUE if it's output */29protectedlongcurrentSuperstep = -1; 30 31/**How many vertices were loaded until now */32protectedlongverticesLoaded = 0; 33/**How many vertex input splits were loaded until now */34protectedintvertexInputSplitsLoaded = 0; 35/**Whether worker finished loading vertices */36protectedbooleanloadingVerticesDone = false; 37/**How many edges were loaded */38protectedlongedgesLoaded = 0; 39/**How many edge input splits were loaded until now */40protectedintedgeInputSplitsLoaded = 0; 41/**Whether worker finished loading edges until now */42protectedbooleanloadingEdgesDone = false; 43 44/**How many vertices are there to compute in current superstep */45protectedlongverticesToCompute = 0; 46/**How many vertices were computed in current superstep until now */47protectedlongverticesComputed = 0; 48/**How many partitions are there to compute in current superstep */49protectedintpartitionsToCompute = 0; 50/**How many partitions were computed in current superstep until now */51protectedintpartitionsComputed = 0; 52 53/**Whether all compute supersteps are done */54protectedbooleancomputationDone = false; 55 56/**How many vertices are there to store */57protectedlongverticesToStore = 0; 58/**How many vertices were stored until now */59protectedlongverticesStored = 0; 60/**How many partitions are there to store */61protectedintpartitionsToStore = 0; 62/**How many partitions were stored until now */63protectedintpartitionsStored = 0; 64/**Whether worker finished storing data */65protectedbooleanstoringDone = false; 66 67/**Id of the mapper */68protectedinttaskId; 69 70/**Free memory */71protecteddoublefreeMemoryMB; 72/**Fraction of memory that's free */73protecteddoublefreeMemoryFraction; 74 75/**Lowest percentage of graph in memory throughout the execution so far */76protectedintlowestGraphPercentageInMemory = 100; 77 78publicbooleanisInputSuperstep() { 79returncurrentSuperstep == -1; 80 } 81 82publicbooleanisComputeSuperstep() { 83returncurrentSuperstep >= 0 && currentSuperstep < Long.MAX_VALUE; 84 } 85 86publicbooleanisOutputSuperstep() { 87returncurrentSuperstep == Long.MAX_VALUE; 88 } 89 }