view src/main/java/alice/topology/manager/ConfigWaiter.java @ 655:1c93e82e05c6 default tip

fix timestamp
author suruga
date Sat, 17 Feb 2018 00:33:00 +0900
parents ffaacab84d1a
children
line wrap: on
line source

package alice.topology.manager;

import org.msgpack.type.ValueFactory;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class ConfigWaiter extends CodeSegment {

    public Receiver done = ids.create(CommandType.TAKE);
    public int count;

    public ConfigWaiter(int nodeNum) {
        this.count = nodeNum;
    }

    @Override
    public void run() {
        count--;
        if (count == 0) {
            ods.put("local", "start", ValueFactory.createNilValue());
            ods.put("startTime",System.currentTimeMillis());
            ods.update("running", true);
            return;
        }
        ConfigWaiter cs3 = new ConfigWaiter(count);
        cs3.done.setKey("local", "done");
    }

}