def placeSegments(self, segmentList, deepStorage, percentReplicate, replicationFactor): self.log("Placing Segments") Coordinator.placeSegmentsAndReplicas( segmentList, deepStorage, percentReplicate, replicationFactor, self.historicalNodeList, self.queryList, self.placementStrategy) Utils.printSegmentPlacement(self.historicalNodeList)
def runExperiment(historicalNodeCount, segmentList, percentreplicate, replicationFactor, queryList, placementStrategy, routingStrategy): segmentcount = len(segmentList) #Creating Historical Nodes print "Creating Historical Nodes" historicalnodelist = createHistoricalNodes(historicalNodeCount) #Placing Segments print "Placing Segments" avgreplication = Coordinator.placeSegmentsAndReplicas(segmentList, segmentList, percentreplicate, replicationFactor, historicalnodelist, queryList, placementStrategy) Coordinator.printCurrentPlacement(historicalnodelist) print("%s,%s,%f Average Replication: %f" % (placementStrategy, routingStrategy, percentreplicate, avgreplication)) #Calculating Scores print "Routing Queries" timetaken = Broker.routeQueries(queryList, historicalnodelist, routingStrategy, segmentcount, 0) print("%s,%s,%f Overall Completion Time: %d" % (placementStrategy, routingStrategy, percentreplicate, timetaken))
def placeSegments(self, segmentList, deepStorage, percentReplicate, replicationFactor): self.log("Placing Segments") Coordinator.placeSegmentsAndReplicas(segmentList, deepStorage, percentReplicate, replicationFactor, self.historicalNodeList, self.queryList, self.placementStrategy) Utils.printSegmentPlacement(self.historicalNodeList)
def placeSegments(self, segmentList, time, config): self.log(time, "Placing Segments") (numloads, computetime) = Coordinator.placeSegmentsAndReplicas(segmentList, self.historicalNodeList, self.queryList, self.placementStrategy, self.replicationStrategy, self.segmentReplicaCount, self.pastHistory, time, config) self.numsegmentloads += numloads self.totalcomputetime += computetime Utils.printSegmentPlacement(self.historicalNodeList)