// Path: common/src/main/java/com/fksm/common/util/Constants.java
// public class Constants {
//     /** The Constant REGEX. */
//     public static final String REGEX_UUID = "regex.uuid";
//     public static final String REGEX_IP = "regex.ip";
//     public static final String REGEX_TIME = "regex.time";
// 
//     public static final int TYPE_CALLER_INFO = 1;
//     public static final int TYPE_RESP_PARAM = 2;
//     public static final int TYPE_REQ_PARAM = 3;
//     public static final int TYPE_RESP_TIME = 4;
//     public static final int TYPE_SERVICE_INFO = 5;
// 
//     public static final String REDIS_SERVER_KEY = "SERVER";
// 
//     public static final String REDIS_SERVER_SERVICE_PREFIX = "SERVER_SERVICE_";
//     public static final String REDIS_SERVICE_REQUEST_PREFIX = "SERVICE_REQUEST_";
//     public static final String REDIS_TIME_REQUESTS_PREFIX = "TIME_REQUESTS_";
//     //server->service->requests
//     public static final String REDIS_SERVER_SERVICE_REQUEST_PREFIX = "SERVER_SERVICE_REQUEST_";
// 
//     public static final String REDIS_SERVICE_COSTS_PREFIX = "SERVICE_COSTS_";
//     public static final String REDIS_SERVICE_CALLERS_PREFIX = "SERVICE_CALLERS_";
//     public static final String REDIS_SERVICE_CODES_PREFIX = "SERVICE_CODES_";
// 
//     public static final String REDIS_SERVICE_REQUEST_CALLER_PREFIX = "SERVICE_REQUEST_CALLER_";
//     public static final String REDIS_SERVER_SERVICE_COST_PREFIX = "SERVER_SERVICE_COST_";
//     public static final String REDIS_SERVICE_REQUEST_CODE_PREFIX = "SERVICE_REQUEST_CODE_";
// 
//     public static final String REDIS_SERVER_PREFIX = "S_SERVER_SERVICE_REQUEST_";
//     public static final String REDIS_SERVER_COSTS_PREFIX = "S_SERVER_SERVICE_COSTS_";
//     public static final String REDIS_SERVER_CALLER_PREFIX = "S_SERVER_SERVICE_CALLER_";
//     public static final String REDIS_SERVER_CODE_PREFIX = "S_SERVER_SERVICE_CODE_";
// 
//     public static final String REDIS_TIMELINE_KEY = "TIMELINE_KEY";
// 
//     public static final Integer CODE_SUCESS = 100;
// }
// 
// Path: web-graphc/src/main/java/com/fksm/web/service/common/DemoService.java
// public interface DemoService {
//     /**
//      * getCallers
//      * @return
//      * @throws Exception
//      */
//     public List<HashMap> getCallers(Long startTime, Long endTime, String server_ip, String service_id) throws Exception;
// }


import com.alibaba.fastjson.JSON;
import com.fksm.common.util.Constants;
import com.fksm.web.service.common.DemoService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
package com.fksm.web.service.common.impl;



/**
 * Created by Administrator on 2016/5/7.
 */
@Service("demoService")
public class DemoServiceImpl implements DemoService {

    @Resource(name = "redisTemplate")
    private RedisTemplate<String, String> redisTemplate;

    @Override
    public List<HashMap> getCallers(Long startTime, Long endTime, String server_ip, String service_id) throws Exception {
// Path: common/src/main/java/com/fksm/common/util/Constants.java
// public class Constants {
//     /** The Constant REGEX. */
//     public static final String REGEX_UUID = "regex.uuid";
//     public static final String REGEX_IP = "regex.ip";
//     public static final String REGEX_TIME = "regex.time";
// 
//     public static final int TYPE_CALLER_INFO = 1;
//     public static final int TYPE_RESP_PARAM = 2;
//     public static final int TYPE_REQ_PARAM = 3;
//     public static final int TYPE_RESP_TIME = 4;
//     public static final int TYPE_SERVICE_INFO = 5;
// 
//     public static final String REDIS_SERVER_KEY = "SERVER";
// 
//     public static final String REDIS_SERVER_SERVICE_PREFIX = "SERVER_SERVICE_";
//     public static final String REDIS_SERVICE_REQUEST_PREFIX = "SERVICE_REQUEST_";
//     public static final String REDIS_TIME_REQUESTS_PREFIX = "TIME_REQUESTS_";
//     //server->service->requests
//     public static final String REDIS_SERVER_SERVICE_REQUEST_PREFIX = "SERVER_SERVICE_REQUEST_";
// 
//     public static final String REDIS_SERVICE_COSTS_PREFIX = "SERVICE_COSTS_";
//     public static final String REDIS_SERVICE_CALLERS_PREFIX = "SERVICE_CALLERS_";
//     public static final String REDIS_SERVICE_CODES_PREFIX = "SERVICE_CODES_";
// 
//     public static final String REDIS_SERVICE_REQUEST_CALLER_PREFIX = "SERVICE_REQUEST_CALLER_";
//     public static final String REDIS_SERVER_SERVICE_COST_PREFIX = "SERVER_SERVICE_COST_";
//     public static final String REDIS_SERVICE_REQUEST_CODE_PREFIX = "SERVICE_REQUEST_CODE_";
// 
//     public static final String REDIS_SERVER_PREFIX = "S_SERVER_SERVICE_REQUEST_";
//     public static final String REDIS_SERVER_COSTS_PREFIX = "S_SERVER_SERVICE_COSTS_";
//     public static final String REDIS_SERVER_CALLER_PREFIX = "S_SERVER_SERVICE_CALLER_";
//     public static final String REDIS_SERVER_CODE_PREFIX = "S_SERVER_SERVICE_CODE_";
// 
//     public static final String REDIS_TIMELINE_KEY = "TIMELINE_KEY";
// 
//     public static final Integer CODE_SUCESS = 100;
// }
// 
// Path: web-graphc/src/main/java/com/fksm/web/service/common/DemoService.java
// public interface DemoService {
//     /**
//      * getCallers
//      * @return
//      * @throws Exception
//      */
//     public List<HashMap> getCallers(Long startTime, Long endTime, String server_ip, String service_id) throws Exception;
// }


// Path: web-graphc/src/main/java/com/fksm/web/service/common/impl/DemoServiceImpl.java
import com.alibaba.fastjson.JSON;
import com.fksm.common.util.Constants;
import com.fksm.web.service.common.DemoService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;

package com.fksm.web.service.common.impl;



/**
 * Created by Administrator on 2016/5/7.
 */
@Service("demoService")
public class DemoServiceImpl implements DemoService {

    @Resource(name = "redisTemplate")
    private RedisTemplate<String, String> redisTemplate;

    @Override
    public List<HashMap> getCallers(Long startTime, Long endTime, String server_ip, String service_id) throws Exception {
        String k = Constants.REDIS_SERVER_CALLER_PREFIX + server_ip + "_" + service_id;