/** * Converts bytes to long on input. */ public static long bytesToLong(byte b[]) { return bytesToLong(b, 0); }
public CommandExecLogVO(long hostId, long instanceId, String commandName, int weight) { this.hostId = hostId; this.instanceId = instanceId; this.commandName = commandName; this.weight = weight; this.created = DateUtil.currentGMTTime(); }
@Override public String toString() { if (startTickNanoSeconds == null) { return "Not Started"; } if (stopTickNanoSeconds == null) { return "Started but not stopped"; } return "Done. Duration: " + getDurationInMillis() + "ms"; } }
/** * This method should reorder the given list of Pod Ids by applying any necessary heuristic * for this planner * For FirstFitPlanner there is no specific heuristic to be applied * other than the capacity based ordering which is done by default. * @return List<Long> ordered list of Pod Ids */ protected List<Long> reorderPods(Pair<List<Long>, Map<Long, Double>> podCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan) { List<Long> podIdsByCapacity = podCapacityInfo.first(); return podIdsByCapacity; }
protected static String getSwiftObjectCmd(SwiftClientCfg cfg, String swiftCliPath, String operation,String container, String objectName) { String cmd = getSwiftCmd(cfg,swiftCliPath, operation) +" "+ container+" "+objectName; if(StringUtils.isNotBlank(cfg.getStoragePolicy()) && supportsStoragePolicies(operation)){ return cmd + String.format(WITH_STORAGE_POLICY, cfg.getStoragePolicy()); } return cmd; }
public boolean isAnnotated() { return StringUtils.isNotBlank(annotation); } }
@Override public int hashCode() { return NumbersUtil.hash(id); } }
private Type getSnapshotType(IntervalType intvType) { if (intvType.equals(IntervalType.HOURLY)) { return Type.HOURLY; } else if (intvType.equals(IntervalType.DAILY)) { return Type.DAILY; } else if (intvType.equals(IntervalType.WEEKLY)) { return Type.WEEKLY; } else if (intvType.equals(IntervalType.MONTHLY)) { return Type.MONTHLY; } return null; }
@Override public void record(String msg, Object... params) { record(_logger, Level.DEBUG, msg, params); } }
protected static String getUploadObjectCommand(SwiftClientCfg cfg, String swiftCliPath, String container, String objectName, long size) { String cmd = getSwiftObjectCmd(cfg, swiftCliPath, "upload", container, objectName); if(size > SWIFT_MAX_SIZE){ return cmd + WITH_SEGMENTS; } return cmd; }
public String t(String key) { return getString(key); } }
/** * This method should reorder the given list of Cluster Ids by applying any necessary heuristic * for this planner * For FirstFitPlanner there is no specific heuristic to be applied * other than the capacity based ordering which is done by default. * @return List<Long> ordered list of Cluster Ids */ protected List<Long> reorderClusters(long id, boolean isZone, Pair<List<Long>, Map<Long, Double>> clusterCapacityInfo, VirtualMachineProfile vmProfile, DeploymentPlan plan) { List<Long> reordersClusterIds = clusterCapacityInfo.first(); return reordersClusterIds; }
public ManagementServerHostPeerVO(long ownerMshost, long peerMshost, long peerRunid, ManagementServerHost.State peerState) { this.ownerMshost = ownerMshost; this.peerMshost = peerMshost; this.peerRunid = peerRunid; this.peerState = peerState; lastUpdateTime = DateUtil.currentGMTTime(); }
@Override public int hashCode() { return NumbersUtil.hash(id); } }
public AsyncJobJoinMapVO() { created = DateUtil.currentGMTTime(); lastUpdated = DateUtil.currentGMTTime(); }
@Override public int hashCode() { return NumbersUtil.hash(id); }
@Override public int hashCode() { return NumbersUtil.hash(id); }