Package com.cybozu.vmbkp.config

Examples of com.cybozu.vmbkp.config.Group


    public List<Integer> getDiskIdList()
    {
        List<Integer> ret = new LinkedList<Integer>();
       
        /* Traverse the index (uuid -> diskId) */
        Group diskIndexGroup = this.generateDiskIndexGroup();
        List<Entry> entryList = cfg_.getAllEntries(diskIndexGroup);
        for (Entry entry : entryList) {
            String uuid = entry.getKey();
            String diskIdStr = entry.getVal();

View Full Code Here


    /**
     * Set current time of [disk `diskId`] dump_begin_timestamp_ms.
     */
    public void setDumpBeginTimestamp(int diskId)
    {
        Group diskGroup = this.generateDiskGroup(diskId);
        long timestampMs = Calendar.getInstance().getTimeInMillis();
        cfg_.put(diskGroup, "dump_begin_timestamp_ms",
                 Long.toString(timestampMs));
    }
View Full Code Here

    /**
     * Set current timestamp of [disk `diskId`] dump_end_timestamp_ms.
     */
    public void setDumpEndTimestamp(int diskId)
    {
        Group diskGroup = this.generateDiskGroup(diskId);
        long timestampMs = Calendar.getInstance().getTimeInMillis();
        cfg_.put(diskGroup, "dump_end_timestamp_ms",
                 Long.toString(timestampMs));
    }
View Full Code Here

    /**
     * Get elapsed time in milliseconds to dump disk `diskId`.
     */
    public long getDumpElapsedTimeMs(int diskId)
    {
        Group diskGroup = this.generateDiskGroup(diskId);
       
        String beginStr = cfg_.getVal(diskGroup, "dump_begin_timestamp_ms");
        String endStr = cfg_.getVal(diskGroup, "dump_end_timestamp_ms");
        if (beginStr == null || endStr == null) {
            logger_.warning("beginStr or endStr is is null.");
View Full Code Here

     * Initialize group(s).
     */
    private void initializeGroups()
    {
        /* initialize group(s) */
        grpMeta_ = new Group("meta");
        grpTsGen_ = new Group("index", "timestamp_ms-generation");
    }
View Full Code Here

    private Group makeGenerationGroup(int genId)
    {
        if (genId < 0) {
            logger_.warning("generation id < 0.");
        }
        return new Group("generation", Integer.toString(genId));
    }
View Full Code Here

     * @param genId generation id.
     * @return [generation `genertionId`] status
     */
    public boolean isGenerationSucceeded(int genId)
    {
        Group genGroup = makeGenerationGroup(genId);
        String status = cfg_.getVal(genGroup, "status");
        return (status != null && status.equals("succeeded"));
    }
View Full Code Here

     * @param genId generation id.
     * @param isSucceeded specify true if the genration was succeeded, or false.
     */
    public void setIsGenerationSucceeded(int genId, boolean isSucceeded)
    {
        Group genGroup = makeGenerationGroup(genId);
        cfg_.put(genGroup, "status", (isSucceeded ? "succeeded" : "failed"));
    }
View Full Code Here

     * @return if >=0 that is depending on the generation,
     *         -1 then no dependency.
     */
    public int getDependingGenerationId(int genId)
    {
        Group genGroup = makeGenerationGroup(genId);
        String depGenIdStr = cfg_.getVal(genGroup, "depending_generation_id");
        if (depGenIdStr != null && FormatInt.canBeInt(depGenIdStr)) {
            return FormatInt.toInt(depGenIdStr);
        } else {
            return -1;
View Full Code Here

     * @param genId generation id.
     * @param depGenId genId depends on this.
     */
    public void setDependingGenerationId(int genId, int depGenId)
    {
        Group genGroup = makeGenerationGroup(genId);
        cfg_.put(genGroup, "depending_generation_id",
                 Integer.toString(depGenId));
    }
View Full Code Here

TOP

Related Classes of com.cybozu.vmbkp.config.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.