All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.teasoft.honey.distribution.DefaultWorker Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2016-2020 the original author.All rights reserved.
 * Kingstar([email protected])
 * The license,see the LICENSE file.
 */

package org.teasoft.honey.distribution;

import org.teasoft.bee.distribution.Worker;
import org.teasoft.bee.osql.exception.ConfigWrongException;
import org.teasoft.honey.osql.core.HoneyConfig;

/**
 * @author Kingstar
 * @since  1.8
 */
public class DefaultWorker implements Worker{

	@Override
	public long getWorkerId() {
		int workerid=HoneyConfig.getHoneyConfig().genid_workerid;
		if(workerid<0 || workerid>1023) throw new ConfigWrongException(" workerid is wrong, need in [0,1023]");
		return workerid;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy