<commit_before>package com.infogen;

import java.io.IOException;
import java.time.Clock;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;

import org.apache.log4j.Logger;
import org.apache.thrift.TException;

import com.infogen.http.callback.Http_Callback;
import com.infogen.http.exception.HTTP_Fail_Exception;
import com.infogen.rpc.callback.RPC_Callback;
import com.infogen.rpc.exception.impl.Node_Notfound_Exception;
import com.infogen.rpc.exception.impl.Service_Notfound_Exception;
import com.infogen.rpc.handler.Thrift_Async_Client_Handler;
import com.infogen.rpc.handler.Thrift_Client_Handler;
import com.infogen.server.cache.InfoGen_Cache_Server;
import com.infogen.server.model.RemoteNode;
import com.infogen.server.model.RemoteNode.NetType;
import com.infogen.server.model.RemoteNode.RequestType;
import com.infogen.server.model.RemoteServer;
import com.infogen.tools.NoNodeMail;
import com.infogen.util.BasicNameValuePair;
import com.infogen.util.CODE;
import com.infogen.util.Return;

/**
 * 调用服务的封装 实现调度,错误重试,同步异步处理等
 * 
 * @author larry
 * @email <EMAIL>
 * @version 创建时间 2014年10月30日 下午1:48:19
 */
public class Service {
	private static final Logger LOGGER = Logger.getLogger(Service.class.getName());
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	private static final InfoGen instance = InfoGen.getInstance();
	private static ConcurrentMap<String, RemoteServer> depend_server = InfoGen_Cache_Server.getInstance().depend_server;
	private String server_name;
	private NetType net_type = NetType.LOCAL;

	public static Service create(String server_name) {
		return new Service(server_name);
	}

	public static Service create(String server_name, NetType net_type) {
		return new Service(server_name, net_type);
	}

	public Service(String server_name) {
		this.server_name = server_name;
		// 初始化
		instance.get_server(server_name);
	}

	/**
	 * 指定网络类型是内网还是外网<commit_msg>修改未启动服务就调用的错误提示<commit_after>package com.infogen;

import java.io.IOException;
import java.time.Clock;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;

import org.apache.log4j.Logger;
import org.apache.thrift.TException;

import com.infogen.http.callback.Http_Callback;
import com.infogen.http.exception.HTTP_Fail_Exception;
import com.infogen.rpc.callback.RPC_Callback;
import com.infogen.rpc.exception.impl.Node_Notfound_Exception;
import com.infogen.rpc.exception.impl.Service_Notfound_Exception;
import com.infogen.rpc.handler.Thrift_Async_Client_Handler;
import com.infogen.rpc.handler.Thrift_Client_Handler;
import com.infogen.server.cache.InfoGen_Cache_Server;
import com.infogen.server.model.RemoteNode;
import com.infogen.server.model.RemoteNode.NetType;
import com.infogen.server.model.RemoteNode.RequestType;
import com.infogen.server.model.RemoteServer;
import com.infogen.tools.NoNodeMail;
import com.infogen.util.BasicNameValuePair;
import com.infogen.util.CODE;
import com.infogen.util.Return;

/**
 * 调用服务的封装 实现调度,错误重试,同步异步处理等
 * 
 * @author larry/<EMAIL>/创建时间 2015年7月29日 下午5:34:17
 * @since 1.0
 * @version 1.0
 */
public class Service {
	private static final Logger LOGGER = Logger.getLogger(Service.class.getName());
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	private static final InfoGen instance = InfoGen.getInstance();
	private static ConcurrentMap<String, RemoteServer> depend_server = InfoGen_Cache_Server.getInstance().depend_server;
	private String server_name;
	private NetType net_type = NetType.LOCAL;

	public static Service create(String server_name) {
		return new Service(server_name);
	}

	public static Service create(String server_name, NetType net_type) {
		return new Service(server_name, net_type);
	}

	public Service(String server_name) {
		this.server_name = server_name;
		// 初始化
		instance.get_server(server_name);
	}

	/**
	 * 指定网络类型是内网还是外网
{'fraction_non_alphanumeric': 0.1522867737948084, 'fraction_numerical': 0.007663782447466007, 'mean_word_length': 4.154140127388535, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3384722', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1346, 'n_words': 229}