eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [25/51] [partial] incubator-eagle git commit: EAGLE-184 Migrate eagle website from https://github.com/eaglemonitoring/eaglemonitoring.github.io to document branch
Date Thu, 03 Mar 2016 18:09:58 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceBaseClient.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceBaseClient.java b/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceBaseClient.java
deleted file mode 100644
index 70e92bf..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceBaseClient.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client.impl;
-
-import com.sun.jersey.api.client.AsyncWebResource;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.client.urlconnection.URLConnectionClientHandler;
-import org.apache.eagle.common.Base64;
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.log.entity.meta.EntityDefinition;
-import org.apache.eagle.log.entity.meta.EntityDefinitionManager;
-import org.apache.eagle.service.client.EagleServiceAsyncClient;
-import org.apache.eagle.service.client.EagleServiceClientException;
-import org.apache.eagle.service.client.IEagleServiceClient;
-import org.apache.eagle.service.client.security.SecurityConstants;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.MediaType;
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public abstract class EagleServiceBaseClient implements IEagleServiceClient {
-    public final static String SERVICE_NAME="serviceName";
-    public final static String DELETE_BY_ID="byId";
-
-    private final String host;
-    private final int port;
-    private final String basePath;
-    private String username;
-    private String password;
-    protected boolean silence = false;
-
-    public String getBaseEndpoint() {
-        return baseEndpoint;
-    }
-
-    private final String baseEndpoint;
-
-    private final static Logger LOG = LoggerFactory.getLogger(EagleServiceBaseClient.class);
-
-    protected static final String DEFAULT_BASE_PATH = "/eagle-service/rest";
-    protected static final MediaType DEFAULT_MEDIA_TYPE = MediaType.APPLICATION_JSON_TYPE;
-    protected static final String DEFAULT_HTTP_HEADER_CONTENT_TYPE = "application/json";
-    protected static final String CONTENT_TYPE = "Content-Type";
-
-    protected final static String GENERIC_ENTITY_PATH = "/entities";
-    protected final static String GENERIC_ENTITY_DELETE_PATH = GENERIC_ENTITY_PATH+"/delete";
-    private final Client client;
-    private final List<Closeable> closeables = new LinkedList<Closeable>();
-
-    private volatile boolean isStopped = false;
-
-    public EagleServiceBaseClient(String host, int port, String basePath, String username, String password) {
-        this.host = host;
-        this.port = port;
-        this.basePath = basePath;
-        this.baseEndpoint = buildBathPath().toString();
-        this.username = username;
-        this.password = password;
-
-        ClientConfig cc = new DefaultClientConfig();
-        cc.getProperties().put(DefaultClientConfig.PROPERTY_CONNECT_TIMEOUT, 60 * 1000);
-        cc.getProperties().put(DefaultClientConfig.PROPERTY_READ_TIMEOUT, 60 * 1000);
-        cc.getClasses().add(JacksonJsonProvider.class);
-        cc.getProperties().put(URLConnectionClientHandler.PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND, true);
-        this.client = Client.create(cc);
-        client.addFilter(new com.sun.jersey.api.client.filter.GZIPContentEncodingFilter());
-        //        Runtime.getRuntime().addShutdownHook(new EagleServiceClientShutdownHook(this));
-    }
-
-    public EagleServiceBaseClient(String host, int port, String basePath){
-        this(host, port, basePath, null);
-    }
-
-    public EagleServiceBaseClient(String host, int port, String username, String password){
-        this(host, port, DEFAULT_BASE_PATH, username, password);
-    }
-
-//    private class EagleServiceClientShutdownHook extends Thread{
-//        final IEagleServiceClient client;
-//        EagleServiceClientShutdownHook(IEagleServiceClient client){
-//            this.client = client;
-//        }
-//
-//        @Override
-//        public void run() {
-//            LOG.info("Client shutdown hook");
-//            try {
-//                this.client.close();
-//            } catch (IOException e) {
-//                LOG.error(e.getMessage(),e);
-//            }
-//        }
-//    }
-
-    public Client getJerseyClient(){
-        return client;
-    }
-
-    public EagleServiceBaseClient(String host, int port){
-        this(host,port,DEFAULT_BASE_PATH);
-    }
-
-    protected final StringBuilder buildBathPath() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("http://");
-        sb.append(host);
-        sb.append(":");
-        sb.append(port);
-        sb.append(basePath);
-        return sb;
-    }
-
-    protected static String marshall(List<?> entities) throws JsonMappingException, JsonGenerationException, IOException {
-        final JsonFactory factory = new JsonFactory();
-        final ObjectMapper mapper = new ObjectMapper(factory);
-        mapper.setFilters(TaggedLogAPIEntity.getFilterProvider());
-        return mapper.writeValueAsString(entities);
-    }
-
-    protected <E extends TaggedLogAPIEntity> Map<String,List<E>> groupEntitiesByService(List<E> entities) throws EagleServiceClientException {
-        Map<String,List<E>> serviceEntityMap = new HashMap<String, List<E>>();
-        if(LOG.isDebugEnabled()) LOG.debug("Grouping entities by service name");
-        for(E entity: entities){
-            if(entity == null) {
-                LOG.warn("Skip null entity");
-                continue;
-            }
-
-            try {
-                EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(entity.getClass());
-                if(entityDefinition == null){
-                    throw new EagleServiceClientException("Failed to find entity definition of class: "+entity.getClass());
-                }
-                String serviceName = entityDefinition.getService();
-                List<E> bucket = serviceEntityMap.get(serviceName);
-                if(bucket == null){
-                    bucket = new LinkedList<E>();
-                    serviceEntityMap.put(serviceName, bucket);
-                }
-                bucket.add(entity);
-            } catch (InstantiationException e) {
-                throw new EagleServiceClientException(e);
-            } catch (IllegalAccessException e) {
-                throw new EagleServiceClientException(e);
-            }
-        }
-        return serviceEntityMap;
-    }
-
-    @Override
-    public SearchRequestBuilder search() {
-        return new SearchRequestBuilder(this);
-    }
-
-    @Override
-    public SearchRequestBuilder search(String query) {
-        return new SearchRequestBuilder(this).query(query);
-    }
-
-    protected void register(Closeable closeable){
-        this.closeables.add(closeable);
-    }
-
-    @Override
-    public MetricSender metric(String metricName) {
-        MetricSender metricGenerator = new MetricSender(this,metricName);
-        this.register(metricGenerator);
-        return metricGenerator;
-    }
-
-    protected WebResource getWebResource(String relativePath){
-        return this.getJerseyClient().resource(this.getBaseEndpoint() + relativePath);
-    }
-
-    protected AsyncWebResource getAsyncWebResource(String relativePath){
-        return this.getJerseyClient().asyncResource(this.getBaseEndpoint() + relativePath);
-    }
-
-    protected WebResource.Builder putAuthHeaderIfNeeded(WebResource.Builder r) {
-        if (username != null && password != null) {
-           r.header(SecurityConstants.AUTHORIZATION, SecurityConstants.BASIC_AUTHORIZATION_HEADER_PREFIX + Base64.encode(username + ":" + password));
-        }
-        return r;
-    }
-
-    /**
-     * Send HTTP POST request with entities and serviceName
-     *
-     * @param resourceURL
-     * @param entities
-     * @param serviceName
-     * @return
-     * @throws JsonMappingException
-     * @throws JsonGenerationException
-     * @throws IOException
-     */
-    @SuppressWarnings("unchecked")
-    protected GenericServiceAPIResponseEntity<String> postEntitiesWithService(String resourceURL, List<? extends TaggedLogAPIEntity> entities,String serviceName) throws JsonMappingException, JsonGenerationException, IOException {
-        final String json = marshall(entities);
-        final WebResource r = getWebResource(resourceURL);
-        return putAuthHeaderIfNeeded(r.queryParam(SERVICE_NAME,serviceName).accept(DEFAULT_MEDIA_TYPE))
-                .header(CONTENT_TYPE, DEFAULT_HTTP_HEADER_CONTENT_TYPE)
-                .post(GenericServiceAPIResponseEntity.class, json);
-    }
-
-    /**
-     * Send HTTP PUT request with entities and serviceName
-     *
-     * @param resourceURL
-     * @param entities
-     * @param serviceName
-     * @return
-     * @throws JsonMappingException
-     * @throws JsonGenerationException
-     * @throws IOException
-     */
-    @SuppressWarnings("unchecked")
-    protected GenericServiceAPIResponseEntity<String> putEntitiesWithService(String resourceURL, List<? extends TaggedLogAPIEntity> entities,String serviceName) throws JsonMappingException, JsonGenerationException, IOException {
-        final String json = marshall(entities);
-        final WebResource r = getWebResource(resourceURL);
-        return putAuthHeaderIfNeeded(r.queryParam(SERVICE_NAME,serviceName).accept(DEFAULT_MEDIA_TYPE))
-                .header(CONTENT_TYPE, DEFAULT_HTTP_HEADER_CONTENT_TYPE)
-                .put(GenericServiceAPIResponseEntity.class, json);
-    }
-
-
-    protected <E extends TaggedLogAPIEntity> String getServiceNameByClass(Class<E> entityClass) throws EagleServiceClientException {
-        EntityDefinition entityDefinition = null;
-        try {
-            entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(entityClass);
-        } catch (InstantiationException e) {
-            throw new EagleServiceClientException(e);
-        } catch (IllegalAccessException e) {
-            throw new EagleServiceClientException(e);
-        }
-
-        if(entityDefinition == null){
-            throw new EagleServiceClientException("cannot find entity definition of class "+entityClass);
-        }
-        return entityDefinition.getService();
-    }
-
-
-    @Override
-    public BatchSender batch(int batchSize) {
-        BatchSender batchSender = new BatchSender(this,batchSize);
-        this.register(batchSender);
-        return batchSender;
-    }
-
-    @Override
-    public EagleServiceAsyncClient async() {
-        EagleServiceAsyncClient async = new EagleServiceAsyncClientImpl(this);
-        this.register(async);
-        return async;
-    }
-
-    @Override
-    public ConcurrentSender parallel(int parallelNum) {
-        ConcurrentSender concurrentSender = new ConcurrentSender(this,parallelNum);
-        this.register(concurrentSender);
-        return concurrentSender;
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> delete(List<E> entities, Class<E> entityClass) throws IOException, EagleServiceClientException {
-        return delete(entities, getServiceNameByClass(entityClass));
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> create(List<E> entities, Class<E> entityClass) throws IOException, EagleServiceClientException {
-        return create(entities, getServiceNameByClass(entityClass));
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> update(List<E> entities, Class<E> entityClass) throws IOException, EagleServiceClientException {
-        return update(entities, getServiceNameByClass(entityClass));
-    }
-
-    @Override
-    public void close() throws IOException {
-        if(!this.isStopped) {
-            if(LOG.isDebugEnabled()) LOG.debug("Client is closing");
-            for (Closeable closeable : this.closeables) {
-                try {
-                    closeable.close();
-                } catch (IOException e) {
-                    LOG.error(e.getMessage(), e);
-                    throw e;
-                }
-            }
-        }
-        this.isStopped = true;
-    }
-
-    @Override
-    public DeleteRequestBuilder delete() {
-        return new DeleteRequestBuilder(this);
-    }
-
-    protected void checkNotNull(Object obj,String name) throws EagleServiceClientException{
-        if(obj == null) throw new EagleServiceClientException(name+" should not be null but given");
-    }
-
-    @Override
-    public EagleServiceBaseClient silence(boolean silence) {
-        this.silence = silence;
-        return this;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceClientImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceClientImpl.java b/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceClientImpl.java
deleted file mode 100644
index 6018469..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/EagleServiceClientImpl.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client.impl;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.service.client.EagleServiceClientException;
-import org.apache.eagle.service.client.EagleServiceConnector;
-import org.apache.eagle.service.client.EagleServiceSingleEntityQueryRequest;
-import com.sun.jersey.api.client.WebResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public class EagleServiceClientImpl extends EagleServiceBaseClient {
-    private final static Logger LOG = LoggerFactory.getLogger(EagleServiceClientImpl.class);
-
-    public EagleServiceClientImpl(String host, int port){
-        super(host, port);
-    }
-
-    public EagleServiceClientImpl(EagleServiceConnector connector){
-        this(connector.getEagleServiceHost(), connector.getEagleServicePort(), connector.getUsername(), connector.getPassword());
-    }
-
-    public EagleServiceClientImpl(String host, int port, String username, String password){
-        super(host, port, username, password);
-    }
-
-    private String getWholePath(String urlString){
-    	return getBaseEndpoint() + urlString;
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> create(List<E> entities, String serviceName) throws IOException,EagleServiceClientException {
-        checkNotNull(serviceName,"serviceName");
-        checkNotNull(entities,"entities");
-
-        final GenericServiceAPIResponseEntity<String> response;
-        response = postEntitiesWithService(GENERIC_ENTITY_PATH, entities, serviceName);
-        if (!response.isSuccess()) {
-            LOG.error("Failed to create entities for service: " + serviceName);
-        }
-        return response;
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> create(List<E> entities) throws IOException, EagleServiceClientException {
-        checkNotNull(entities,"entities");
-
-        Map<String,List<E>> serviceEntityMap = groupEntitiesByService(entities);
-        if(LOG.isDebugEnabled()) LOG.debug("Creating entities for "+serviceEntityMap.keySet().size()+" services");
-
-        List<String> createdKeys = new LinkedList<String>();
-
-        for(Map.Entry<String,List<E>> entry: serviceEntityMap.entrySet()){
-            GenericServiceAPIResponseEntity<String> response = create(entry.getValue(),entry.getKey());
-            if(!response.isSuccess()){
-                throw new IOException("Service side exception: "+response.getException());
-            }else if(response.getObj()!=null){
-                createdKeys.addAll(response.getObj());
-            }
-        }
-        GenericServiceAPIResponseEntity<String> entity = new GenericServiceAPIResponseEntity<String>();
-        entity.setObj(createdKeys);
-        entity.setSuccess(true);
-        return entity;
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> delete(List<E> entities) throws IOException, EagleServiceClientException {
-        checkNotNull(entities,"entities");
-
-        Map<String,List<E>> serviceEntityMap = groupEntitiesByService(entities);
-        if(LOG.isDebugEnabled()) LOG.debug("Creating entities for "+serviceEntityMap.keySet().size()+" services");
-
-        List<String> deletedKeys = new LinkedList<String>();
-        for(Map.Entry<String,List<E>> entry: serviceEntityMap.entrySet()){
-            GenericServiceAPIResponseEntity<String> response = delete(entry.getValue(), entry.getKey());
-            if(!response.isSuccess()){
-                LOG.error("Got service exception: "+response.getException());
-                throw new IOException(response.getException());
-            }else if(response.getObj()!=null){
-                deletedKeys.addAll(response.getObj());
-            }
-        }
-        GenericServiceAPIResponseEntity<String> entity = new GenericServiceAPIResponseEntity<String>();
-        entity.setObj(deletedKeys);
-        entity.setSuccess(true);
-        return entity;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> delete(List<E> entities, String serviceName) throws IOException,EagleServiceClientException {
-        checkNotNull(entities,"entities");
-        checkNotNull(serviceName,"serviceName");
-
-        return postEntitiesWithService(GENERIC_ENTITY_DELETE_PATH,entities,serviceName);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public GenericServiceAPIResponseEntity<String> delete(EagleServiceSingleEntityQueryRequest request) throws IOException,EagleServiceClientException {
-        String queryString = request.getQueryParameterString();
-        StringBuilder sb = new StringBuilder();
-        sb.append(GENERIC_ENTITY_PATH);
-        sb.append("?");
-        sb.append(queryString);
-        final String urlString =  sb.toString();
-
-        if(!this.silence) LOG.info("Going to delete by querying service: " + getWholePath(urlString));
-        WebResource r = getWebResource(urlString);
-        return putAuthHeaderIfNeeded(r.accept(DEFAULT_MEDIA_TYPE)
-                                      .header(CONTENT_TYPE, DEFAULT_HTTP_HEADER_CONTENT_TYPE))
-                                      .delete(GenericServiceAPIResponseEntity.class);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public GenericServiceAPIResponseEntity<String> deleteById(List<String> ids, String serviceName) throws EagleServiceClientException, IOException {
-        checkNotNull(serviceName,"serviceName");
-        checkNotNull(ids,"ids");
-
-        final String json = marshall(ids);
-        final WebResource r = getWebResource(GENERIC_ENTITY_DELETE_PATH);
-        return putAuthHeaderIfNeeded(r.queryParam(SERVICE_NAME,serviceName)
-                                       .queryParam(DELETE_BY_ID, "true")
-                                       .accept(DEFAULT_MEDIA_TYPE))
-                                       .header(CONTENT_TYPE, DEFAULT_HTTP_HEADER_CONTENT_TYPE)
-                                       .post(GenericServiceAPIResponseEntity.class, json);
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> update(List<E> entities) throws IOException, EagleServiceClientException {
-        checkNotNull(entities,"entities");
-
-        Map<String,List<E>> serviceEntityMap = groupEntitiesByService(entities);
-        if(LOG.isDebugEnabled()) LOG.debug("Updating entities for "+serviceEntityMap.keySet().size()+" services");
-
-        List<String> createdKeys = new LinkedList<String>();
-
-        for(Map.Entry<String,List<E>> entry: serviceEntityMap.entrySet()){
-            GenericServiceAPIResponseEntity<String> response = update(entry.getValue(), entry.getKey());
-            if(!response.isSuccess()){
-                throw new IOException("Got service exception when updating service "+entry.getKey()+" : "+response.getException());
-            }else{
-                if(response.getObj()!=null) {
-                    createdKeys.addAll(response.getObj());
-                }
-            }
-        }
-
-        GenericServiceAPIResponseEntity<String> entity = new GenericServiceAPIResponseEntity<String>();
-        entity.setObj(createdKeys);
-        entity.setSuccess(true);
-        return entity;
-    }
-
-    @Override
-    public <E extends TaggedLogAPIEntity> GenericServiceAPIResponseEntity<String> update(List<E> entities, String serviceName) throws IOException, EagleServiceClientException {
-        checkNotNull(entities,"entities");
-        checkNotNull(serviceName,"serviceName");
-
-        return putEntitiesWithService(GENERIC_ENTITY_PATH,entities,serviceName);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public <T extends Object> GenericServiceAPIResponseEntity<T> search(EagleServiceSingleEntityQueryRequest request) throws EagleServiceClientException {
-        String queryString = request.getQueryParameterString();
-        StringBuilder sb = new StringBuilder();
-        sb.append(GENERIC_ENTITY_PATH);
-        sb.append("?");
-        sb.append(queryString);
-        final String urlString =  sb.toString();
-        if(!this.silence) LOG.info("Going to query service: " + getWholePath(urlString));
-        WebResource r = getWebResource(urlString);
-        return putAuthHeaderIfNeeded(r.accept(DEFAULT_MEDIA_TYPE))
-                                       .header(CONTENT_TYPE, DEFAULT_HTTP_HEADER_CONTENT_TYPE)
-                                       .get(GenericServiceAPIResponseEntity.class);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/MetricSender.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/MetricSender.java b/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/MetricSender.java
deleted file mode 100644
index dce5045..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/MetricSender.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client.impl;
-
-import org.apache.eagle.log.entity.GenericMetricEntity;
-import org.apache.eagle.service.client.IEagleServiceClient;
-import org.apache.eagle.service.client.EagleServiceClientException;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class MetricSender extends BatchSender {
-    private final String metricName;
-    private Map<String, String> tags;
-
-    public MetricSender(IEagleServiceClient client, String metricName) {
-        super(client,1);
-        this.metricName = metricName;
-    }
-
-    public MetricSender batch(int batchSize) {
-        super.setBatchSize(batchSize);
-        return this;
-    }
-
-    public MetricSender tags(Map<String,String> tags){
-        this.tags = tags;
-        return this;
-    }
-
-    public MetricSender send(String metricName,long timestamp,Map<String,String> tags,double ...values) throws IOException, EagleServiceClientException {
-        GenericMetricEntity metric = new GenericMetricEntity();
-        metric.setPrefix(metricName);
-        metric.setValue(values);
-        metric.setTimestamp(timestamp);
-        metric.setTags(tags);
-        super.send(metric);
-        return this;
-    }
-
-    public MetricSender send(Long timestamp,Map<String,String> tags,double ...values) throws IOException, EagleServiceClientException {
-        return this.send(this.metricName,timestamp,tags,values);
-    }
-
-    public MetricSender send(Long timestamp, double ... values) throws IOException, EagleServiceClientException {
-        return this.send(timestamp,new HashMap<String, String>(this.tags),values);
-    }
-
-//    public EagleServiceMetricSender send(String metricName,Map<String,String> tags,double ... values) throws IOException, EagleServiceClientException {
-//        return this.send(metricName,System.currentTimeMillis(),tags,values);
-//    }
-//
-//    public EagleServiceMetricSender send(Map<String,String> tags,double ...values) throws IOException, EagleServiceClientException {
-//        return this.send(this.metricName,System.currentTimeMillis(),tags,values);
-//    }
-//
-//    public EagleServiceMetricSender send(double ... values) throws IOException, EagleServiceClientException {
-//        return this.send(System.currentTimeMillis(), new HashMap<String, String>(this.tags), values);
-//    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/SearchRequestBuilder.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/SearchRequestBuilder.java b/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/SearchRequestBuilder.java
deleted file mode 100644
index 331043c..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/impl/SearchRequestBuilder.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client.impl;
-
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.service.client.IEagleServiceClient;
-import org.apache.eagle.service.client.EagleServiceClientException;
-import org.apache.eagle.service.client.EagleServiceSingleEntityQueryRequest;
-import org.apache.eagle.common.DateTimeUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-public class SearchRequestBuilder {
-    private final EagleServiceSingleEntityQueryRequest request;
-    private final IEagleServiceClient client;
-    private final static Logger LOG = LoggerFactory.getLogger(SearchRequestBuilder.class);
-
-    public SearchRequestBuilder(IEagleServiceClient client) {
-        this.request = new EagleServiceSingleEntityQueryRequest();
-        this.client = client;
-    }
-
-    public SearchRequestBuilder query(String query){
-        try {
-            this.request.setQuery(URLEncoder.encode(query,"UTF-8"));
-        } catch (UnsupportedEncodingException e) {
-            LOG.error(e.getMessage(),e);
-        }
-        return this;
-    }
-
-    public SearchRequestBuilder startRowkey(String startRowkey){
-        this.request.setStartRowkey(startRowkey);
-        return this;
-    }
-
-    public SearchRequestBuilder pageSize(int pageSize){
-        this.request.setPageSize(pageSize);
-        return this;
-    }
-
-    public SearchRequestBuilder startTime(long startTime){
-        this.request.setStartTime(startTime);
-        return this;
-    }
-
-    public SearchRequestBuilder startTime(String startTime){
-        this.request.setStartTime(DateTimeUtil.humanDateToMillisecondsWithoutException(startTime));
-        return this;
-    }
-
-    public SearchRequestBuilder endTime(long endTime){
-        this.request.setEndTime(endTime);
-        return this;
-    }
-
-    public SearchRequestBuilder endTime(String endTime){
-        this.request.setEndTime(DateTimeUtil.humanDateToMillisecondsWithoutException(endTime));
-        return this;
-    }
-
-    public SearchRequestBuilder treeAgg(boolean treeAgg){
-        this.request.setTreeAgg(treeAgg);
-        return this;
-    }
-
-    public SearchRequestBuilder metricName(String metricName){
-        this.request.setMetricName(metricName);
-        return this;
-    }
-
-    public SearchRequestBuilder filterIfMissing(Boolean filterIfMissing){
-        this.request.setFilterIfMissing(filterIfMissing);
-        return this;
-    }
-
-    public <T> GenericServiceAPIResponseEntity<T> send() throws EagleServiceClientException {
-        return client.search(this.request);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/security/SecurityConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/security/SecurityConstants.java b/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/security/SecurityConstants.java
deleted file mode 100644
index 9c5e85b..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/main/java/org/apache/eagle/service/client/security/SecurityConstants.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client.security;
-
-public class SecurityConstants {
-    public static final String AUTHORIZATION = "Authorization";
-    public static final String BASIC_AUTHORIZATION_HEADER_PREFIX = "Basic ";
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/Base.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/Base.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/Base.java
deleted file mode 100644
index 1f54f00..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/Base.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.codehaus.jackson.annotate.JsonSubTypes;
-import org.codehaus.jackson.annotate.JsonTypeInfo;
-
-
-//@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-@JsonTypeInfo(use=JsonTypeInfo.Id.NAME )
-@JsonSubTypes({
-    @JsonSubTypes.Type(value=ClassA.class, name="ClassA"),
-    @JsonSubTypes.Type(value=ClassB.class, name="ClassB")
-})
-public abstract class Base {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassA.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassA.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassA.java
deleted file mode 100644
index 60158fc..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassA.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.codehaus.jackson.annotate.JsonTypeName;
-
-
-@JsonTypeName("ClassA")
-public class ClassA extends Base {
-
-	private int a;
-
-	public int getA() {
-		return a;
-	}
-
-	public void setA(int a) {
-		this.a = a;
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassB.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassB.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassB.java
deleted file mode 100644
index faa20ba..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClassB.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.codehaus.jackson.annotate.JsonTypeName;
-
-@JsonTypeName("ClassB")
-public class ClassB extends Base {
-
-	private String b;
-
-	public String getB() {
-		return b;
-	}
-
-	public void setB(String b) {
-		this.b = b;
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClientTestBase.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClientTestBase.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClientTestBase.java
deleted file mode 100644
index ac16b93..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/ClientTestBase.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.apache.eagle.service.hbase.EmbeddedHbase;
-
-public class ClientTestBase {
-	
-	//protected static EmbeddedServer server;
-	protected static EmbeddedHbase hbase;
-
-	//@BeforeClass
-	public static void startup() throws Exception {
-		//hbase = EmbeddedHbase.getInstance();
-		//String webappDirLocation = "../../../eagle-webservice/target/eagle-service";
-		//server = EmbeddedServer.getInstance(webappDirLocation);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestEagleServiceClientImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestEagleServiceClientImpl.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestEagleServiceClientImpl.java
deleted file mode 100644
index 0625145..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestEagleServiceClientImpl.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.apache.eagle.log.entity.GenericMetricEntity;
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.log.entity.test.TestTimeSeriesAPIEntity;
-import org.apache.eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.eagle.service.client.impl.ConcurrentSender;
-import junit.framework.Assert;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-public class TestEagleServiceClientImpl extends ClientTestBase {
-
-    IEagleServiceClient client = new EagleServiceClientImpl("localhost",38080);
-
-    //@Before
-    public void setUp() {
-        hbase.createTable("unittest", "f");
-    }
-
-    //After
-    public void cleanUp() {
-        hbase.deleteTable("unittest");
-    }
-
-    //@Test
-    public void testCreateAndSearch() throws IOException, EagleServiceClientException, IllegalAccessException, InstantiationException {
-        List<TestTimeSeriesAPIEntity> entities = new ArrayList<TestTimeSeriesAPIEntity>();
-
-        for(int i=0;i<100;i++){
-            TestTimeSeriesAPIEntity entity = new TestTimeSeriesAPIEntity();
-            entity.setTimestamp(System.currentTimeMillis());
-            entity.setTags(new HashMap<String, String>() {{
-                put("cluster", "cluster4ut");
-                put("datacenter", "datacenter4ut");
-                put("timestampStr",System.currentTimeMillis()+"");
-            }});
-            entity.setField1(1);
-            entity.setField2(1);
-            entity.setField3(1);
-            entity.setField4(1l);
-            entity.setField5(1l);
-            entity.setField5(1.2);
-            entity.setField6(-1.2);
-            entity.setField7("test unit string attribute");
-            entities.add(entity);
-        }
-
-        GenericServiceAPIResponseEntity response = client.create(entities);
-        assert response.isSuccess();
-        response = client.create(entities,TestTimeSeriesAPIEntity.class);
-        assert response.isSuccess();
-        response = client.create(entities,"TestTimeSeriesAPIEntity");
-        assert response.isSuccess();
-
-        response = client.search("TestTimeSeriesAPIEntity[]{*}")
-                .startTime(0)
-                .endTime(System.currentTimeMillis() + 25 * 3600 * 1000)
-                .pageSize(1000)
-                .send();
-
-        assert  response.isSuccess();
-        assert response.getObj().size() > 0;
-    }
-
-    private TestTimeSeriesAPIEntity newEntity(){
-        TestTimeSeriesAPIEntity entity = new TestTimeSeriesAPIEntity();
-        entity.setTimestamp(System.currentTimeMillis());
-        entity.setTags(new HashMap<String, String>() {{
-            put("cluster", "cluster4ut");
-            put("datacenter", "datacenter4ut");
-        }});
-        entity.setField1(1);
-        entity.setField2(1);
-        entity.setField3(1);
-        entity.setField4(1l);
-        entity.setField5(1l);
-        entity.setField5(1.2);
-        entity.setField6(-1.2);
-        entity.setField7("test unit string attribute");
-        return entity;
-    }
-
-    //@Test
-    public void testUpdate() throws IOException, EagleServiceClientException, IllegalAccessException, InstantiationException {
-        List<TestTimeSeriesAPIEntity> entities = new ArrayList<TestTimeSeriesAPIEntity>();
-        for(int i=0;i<100;i++){
-            TestTimeSeriesAPIEntity entity = new TestTimeSeriesAPIEntity();
-            entity.setTimestamp(System.currentTimeMillis());
-            entity.setTags(new HashMap<String, String>() {{
-                put("cluster", "cluster4ut");
-                put("datacenter", "datacenter4ut");
-            }});
-            entity.setField1(1);
-            entity.setField2(1);
-            entity.setField3(1);
-            entity.setField4(1l);
-            entity.setField5(1l);
-            entity.setField5(1.2);
-            entity.setField6(-1.2);
-            entity.setField7("updated");
-            entities.add(entity);
-        }
-
-        GenericServiceAPIResponseEntity response = client.update(entities);
-        assert response.isSuccess();
-        response = client.update(entities, TestTimeSeriesAPIEntity.class);
-        assert response.isSuccess();
-        response = client.update(entities, "TestTimeSeriesAPIEntity");
-        assert response.isSuccess();
-
-        response = client.search("TestTimeSeriesAPIEntity[]{*}")
-                .startTime(0)
-                .endTime(System.currentTimeMillis() + 25 * 3600 * 1000)
-                .pageSize(1000)
-                .send();
-
-        assert response.isSuccess();
-        assert response.getObj().size() > 0;
-    }
-
-    //@Test
-    public void testDelete() throws IOException, EagleServiceClientException {
-        List<TestTimeSeriesAPIEntity> entities = new ArrayList<TestTimeSeriesAPIEntity>();
-        for(int i=0;i<100;i++){
-            TestTimeSeriesAPIEntity entity = new TestTimeSeriesAPIEntity();
-            entity.setTimestamp(System.currentTimeMillis());
-            entity.setTags(new HashMap<String, String>() {{
-                put("cluster", "cluster4ut");
-                put("datacenter", "datacenter4ut");
-            }});
-
-            entity.setField1(1);
-            entity.setField2(1);
-            entity.setField3(1);
-            entity.setField4(1l);
-            entity.setField5(1l);
-            entity.setField5(1.2);
-            entity.setField6(-1.2);
-            entity.setField7(" unit test oriented string attribute");
-            entities.add(entity);
-        }
-
-        GenericServiceAPIResponseEntity response = client.delete(entities);
-        assert response.isSuccess();
-        response = client.delete(entities, TestTimeSeriesAPIEntity.class);
-        assert response.isSuccess();
-        response = client.delete(entities, "TestTimeSeriesAPIEntity");
-        assert response.isSuccess();
-
-        response = client.delete()
-                .byId(Arrays.asList("30RR1H___rOqxUr5M_sR-g5RxZlmldR_9eQ49A"))
-                .serviceName("TestTimeSeriesAPIEntity")
-                .send();
-
-        assert response.isSuccess();
-
-        response = client.delete()
-                .byQuery("TestTimeSeriesAPIEntity[]{*}")
-                .startTime(0)
-                .endTime(System.currentTimeMillis())
-                .pageSize(1000)
-                .send();
-
-        assert response.isSuccess();
-    }
-
-    //@Test
-    public void testMetricsSender() throws IOException, EagleServiceClientException {
-        List<GenericMetricEntity> entities = new ArrayList<GenericMetricEntity>();
-
-        Map<String,String> tags = new HashMap<String, String>() {{
-            put("cluster", "cluster4ut");
-            put("datacenter", "datacenter4ut");
-        }};
-
-        for(int i=0;i<100;i++){
-            GenericMetricEntity entity = new GenericMetricEntity();
-            entity.setTimestamp(System.currentTimeMillis());
-            entity.setTags(tags);
-            entity.setValue(new double[]{1.234});
-            entity.setPrefix("unit.test.metrics");
-            entities.add(entity);
-        }
-
-        GenericServiceAPIResponseEntity response = client.create(entities);
-        assert response.isSuccess();
-        response = client.create(entities,GenericMetricEntity.class);
-        assert response.isSuccess();
-        response = client.create(entities,GenericMetricEntity.GENERIC_METRIC_SERVICE);
-        assert response.isSuccess();
-
-        client.metric("unit.test.metrics")
-                .batch(5)
-                .tags(tags)
-                .send("unit.test.anothermetrics", System.currentTimeMillis(), tags, 0.1, 0.2, 0.3)
-                .send(System.currentTimeMillis(), 0.1)
-                .send(System.currentTimeMillis(),0.1,0.2)
-                .send(System.currentTimeMillis(),0.1,0.2,0.3)
-                .send(System.currentTimeMillis(),tags,0.1,0.2,0.3)
-                .send("unit.test.anothermetrics",System.currentTimeMillis(),tags,0.1,0.2,0.3)
-                .flush();
-
-        GenericServiceAPIResponseEntity<GenericMetricEntity> metricResponse = client.search("GenericMetricService[@cluster=\"cluster4ut\" AND @datacenter = \"datacenter4ut\"]{*}")
-                .startTime(0)
-                .endTime(System.currentTimeMillis()+24 * 3600 * 1000)
-                .metricName("unit.test.metrics")
-                .pageSize(1000)
-                .send();
-        List<GenericMetricEntity> metricEntities = metricResponse.getObj();
-        assert metricEntities != null;
-        assert metricResponse.isSuccess();
-
-        GenericServiceAPIResponseEntity<Map> metricAggResponse = client.search("GenericMetricService[@cluster=\"cluster4ut\" AND @datacenter = \"datacenter4ut\"]<@cluster>{sum(value)}")
-                .startTime(0)
-                .endTime(System.currentTimeMillis()+24 * 3600 * 1000)
-                .metricName("unit.test.metrics")
-                .pageSize(1000)
-                .send();
-        List<Map> aggResult = metricAggResponse.getObj();
-        assert aggResult != null;
-        assert metricAggResponse.isSuccess();
-
-        client.close();
-    }
-
-    //@Test
-    public void testBatchSender() throws IOException, EagleServiceClientException {
-        client.batch(2)
-                .send(newEntity())
-                .send(newEntity())
-                .send(newEntity());
-        client.close();
-    }
-
-    //@Test
-    public void testAsyncSender() throws IOException, EagleServiceClientException, ExecutionException, InterruptedException {
-        EagleServiceAsyncClient asyncClient = client.async();
-
-        Future<GenericServiceAPIResponseEntity<String>> future1 =
-                asyncClient.create(Arrays.asList(newEntity()));
-
-        GenericServiceAPIResponseEntity<String> response1 = future1.get();
-
-        Assert.assertTrue(response1.isSuccess());
-
-        Future<GenericServiceAPIResponseEntity<String>> future2 =
-                asyncClient.update(Arrays.asList(newEntity()));
-
-        GenericServiceAPIResponseEntity<String> response2 = future2.get();
-
-        Assert.assertTrue(response2.isSuccess());
-
-        Future<GenericServiceAPIResponseEntity<String>> future3 =
-                asyncClient.delete(Arrays.asList(newEntity()));
-
-        GenericServiceAPIResponseEntity<String> response3 = future3.get();
-
-        Assert.assertTrue(response3.isSuccess());
-
-        client.close();
-    }
-
-    //@Test
-    public void testParallelSender() throws IOException, EagleServiceClientException, InterruptedException {
-        // Case #1:
-        ConcurrentSender concurrentSender = client
-                .parallel(10)
-                .batchSize(30)
-                .batchInterval(1000);
-
-        int num = 1000;
-
-        for(int i=0; i< num;i++) {
-            concurrentSender.send(Arrays.asList(newEntity()));
-        }
-
-        // Case #2:
-        ConcurrentSender concurrentSender2 = client
-                .parallel(10)
-                .batchSize(20)
-                .batchInterval(3);
-
-        int num2 = 50;
-
-        for(int i=0; i< num2;i++) {
-            concurrentSender2.send(Arrays.asList(newEntity()));
-            Thread.sleep(1);
-        }
-        client.close();
-    }
-
-    //@Test
-    public void testSearch() throws EagleServiceClientException, IOException {
-        hbase.createTable("eagle_metric", "f");
-
-        GenericServiceAPIResponseEntity<TestTimeSeriesAPIEntity> response =
-                client.search("TestTimeSeriesAPIEntity[]{*}").startTime(0).endTime(System.currentTimeMillis()+1000).pageSize(1000).send();
-
-        Assert.assertTrue(response.isSuccess());
-
-        GenericServiceAPIResponseEntity<Map> response2 =
-                client.search("TestTimeSeriesAPIEntity[]<@cluster>{count}").startTime(0).endTime(System.currentTimeMillis()+1000).pageSize(1000).send();
-
-        Assert.assertTrue(response2.isSuccess());
-
-        GenericServiceAPIResponseEntity<GenericMetricEntity> response3 =
-                client.search("GenericMetricService[@cluster = \"cluster4ut\" AND @datacenter = \"datacenter4ut\"]{*}").metricName("unit.test.metrics").startTime(0).endTime(System.currentTimeMillis()+1000).pageSize(1000).send();
-
-        Assert.assertTrue(response3.isSuccess());
-        hbase.deleteTable("eagle_metric");
-    }
-
-    @Test
-    public void test() {
-
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestIEagleServiceClient.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestIEagleServiceClient.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestIEagleServiceClient.java
deleted file mode 100644
index a144118..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestIEagleServiceClient.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import org.apache.eagle.common.config.EagleConfigFactory;
-import org.apache.eagle.log.entity.GenericMetricEntity;
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import org.apache.eagle.log.entity.meta.EntityDefinition;
-import org.apache.eagle.log.entity.meta.EntityDefinitionManager;
-import org.apache.eagle.service.client.impl.EagleServiceClientImpl;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class TestIEagleServiceClient extends ClientTestBase {
-    IEagleServiceClient client;
-    //@Before
-    public void setUp(){
-        client = new EagleServiceClientImpl("localhost", EagleConfigFactory.load().getServicePort());
-    }
-
-    /**
-     * Just compiling passed is ok
-     */
-    //@Test
-    @SuppressWarnings("unused")
-    public void testCreate() throws IOException, EagleServiceClientException, IllegalAccessException, InstantiationException {
-        EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(GenericMetricEntity.class);
-        hbase.createTable(entityDefinition.getTable(), entityDefinition.getColumnFamily());
-
-        client = new EagleServiceClientImpl("localhost", EagleConfigFactory.load().getServicePort());
-        List<GenericMetricEntity> metricEntityList = new ArrayList<GenericMetricEntity>();
-        GenericServiceAPIResponseEntity<String> unTypedResponse = client.create(metricEntityList);
-        GenericServiceAPIResponseEntity<String> weakTypedResponse = client.create(metricEntityList,GenericMetricEntity.GENERIC_METRIC_SERVICE);
-        GenericServiceAPIResponseEntity<String> strongTypedResponse = client.create(metricEntityList,GenericMetricEntity.class);
-
-        GenericServiceAPIResponseEntity<GenericMetricEntity> weakTypedSearchResponse = client.search("").send();
-        if(weakTypedSearchResponse!=null) {
-            Class<GenericMetricEntity> typedClazz = weakTypedSearchResponse.getType();
-            List<GenericMetricEntity> typedEntities = weakTypedSearchResponse.getObj();
-        }
-    }
-
-    @Test
-    public void test() {
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestJackson.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestJackson.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestJackson.java
deleted file mode 100644
index 73d28be..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/client/TestJackson.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.client;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.junit.Test;
-
-// http://wiki.fasterxml.com/JacksonPolymorphicDeserialization
-public class TestJackson {
-
-	@Test
-	public void testBase() throws JsonGenerationException, JsonMappingException, IOException {
-		List<Base> objs = new ArrayList<Base>();
-		ClassA a = new ClassA();
-		a.setA(1);
-		ClassB b = new ClassB();
-		b.setB("2");
-		
-		objs.add(a);
-		objs.add(b);
-		
-		ObjectMapper om = new ObjectMapper();
-		om.enableDefaultTyping();
-//		om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
-		String value = om.writeValueAsString(objs);
-		
-		System.out.println("value = " + value);
-		
-		@SuppressWarnings("rawtypes")
-		List result = om.readValue(value, ArrayList.class);
-		System.out.println("size = " + result.size());
-		Object obj1 = result.get(0);
-		Object obj2 = result.get(1);
-		
-		Assert.assertEquals("ClassA", obj1.getClass().getSimpleName());
-		Assert.assertEquals(1, ((ClassA)obj1).getA());
-		Assert.assertEquals("ClassB", obj2.getClass().getSimpleName());
-		Assert.assertEquals("2", ((ClassB)obj2).getB());
-		
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/jackson/TestJacksonMarshalling.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/jackson/TestJacksonMarshalling.java b/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/jackson/TestJacksonMarshalling.java
deleted file mode 100644
index 808ee9a..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/java/org/apache/eagle/service/jackson/TestJacksonMarshalling.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.jackson;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TestJacksonMarshalling {
-	private static Logger LOG = LoggerFactory.getLogger(TestJacksonMarshalling.class);
-
-	
-	
-	@Test
-	public void testJSonArrayMarshalling(){
-		String[] array = {"cluster", "datacenter", "rack", "hostname"};
-		JsonFactory factory = new JsonFactory(); 
-	    ObjectMapper mapper = new ObjectMapper(factory);
-	    String result = null;
-	    try{
-	    	result = mapper.writeValueAsString(array);
-	    }catch(Exception ex){
-	    	LOG.error("Cannot marshall", ex);
-	    	Assert.fail("cannot marshall an String array");
-	    }
-	    Assert.assertEquals("[\"cluster\",\"datacenter\",\"rack\",\"hostname\"]", result);
-	}
-	
-
-	static class Pojo{
-		private String field1;
-		private String field2;
-		public String getField1() {
-			return field1;
-		}
-		public void setField1(String field1) {
-			this.field1 = field1;
-		}
-		public String getField2() {
-			return field2;
-		}
-		public void setField2(String field2) {
-			this.field2 = field2;
-		}
-	}
-	
-	@Test
-	public void testPojoMarshalling(){
-		Pojo p = new Pojo();
-		p.setField1("field1");
-		p.setField2("field2");
-		
-		JsonFactory factory = new JsonFactory(); 
-	    ObjectMapper mapper = new ObjectMapper(factory);
-	    String result = null;
-	    try{
-	    	result = mapper.writeValueAsString(p);
-	    }catch(Exception ex){
-	    	LOG.error("Cannot marshall", ex);
-	    	Assert.fail("Cannot marshall a Pojo");
-	    }
-	    System.out.println(result);
-	    Assert.assertEquals("{\"field1\":\"field1\",\"field2\":\"field2\"}", result);
-	}
-	
-	@Test
-	public void testPojoArrayMashalling(){
-		Pojo[] ps = new Pojo[2];
-		ps[0] = new Pojo();
-		ps[0].setField1("0_field1");
-		ps[0].setField2("0_field2");
-		ps[1] = new Pojo();
-		ps[1].setField1("1_field1");
-		ps[1].setField2("1_field2");
-		
-		JsonFactory factory = new JsonFactory(); 
-	    ObjectMapper mapper = new ObjectMapper(factory);
-	    String result = null;
-	    try{
-	    	result = mapper.writeValueAsString(ps);
-	    }catch(Exception ex){
-	    	LOG.error("Cannot marshall", ex);
-	    	Assert.fail("Cannot marshall a Pojo array");
-	    }
-	    System.out.println(result);
-	    Assert.assertEquals("[{\"field1\":\"0_field1\",\"field2\":\"0_field2\"},{\"field1\":\"1_field1\",\"field2\":\"1_field2\"}]", result);
-	}
-	
-	@Test
-	public void testComplexMapMarshalling(){
-		Map<List<String>, String> map = new HashMap<List<String>, String>();
-		map.put(Arrays.asList("cluster1","dc1"), "123");
-		map.put(Arrays.asList("cluster1","dc1"), "456");
-		
-		JsonFactory factory = new JsonFactory(); 
-	    ObjectMapper mapper = new ObjectMapper(factory);
-	    String result = null;
-	    try{
-	    	result = mapper.writeValueAsString(map);
-	    }catch(Exception ex){
-	    	LOG.error("Cannot marshall", ex);
-	    	Assert.fail("Cannot marshall a complex map");
-	    }
-	    System.out.println(result);
-	}
-	
-	@Test
-	public void testMapMapMarshalling(){
-		Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>();
-		Map<String, String> childmap1 = new HashMap<String, String>();
-		childmap1.put("dc1", "123");
-		childmap1.put("dc1", "456");
-		map.put("cluster1", childmap1);
-		
-		JsonFactory factory = new JsonFactory(); 
-	    ObjectMapper mapper = new ObjectMapper(factory);
-	    String result = null;
-	    try{
-	    	result = mapper.writeValueAsString(map);
-	    }catch(Exception ex){
-	    	LOG.error("Cannot marshall", ex);
-	    	Assert.fail("Cannot marshall a complex map");
-	    }
-	    System.out.println(result);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-client-base/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-client-base/src/test/resources/log4j.properties b/eagle-core/eagle-query/eagle-client-base/src/test/resources/log4j.properties
deleted file mode 100644
index d59ded6..0000000
--- a/eagle-core/eagle-query/eagle-client-base/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-log4j.rootLogger=INFO, stdout
-
-# standard output
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-common/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/pom.xml b/eagle-core/eagle-query/eagle-common/pom.xml
deleted file mode 100644
index 1e0d79b..0000000
--- a/eagle-core/eagle-query/eagle-common/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>eagle</groupId>
-		<artifactId>eagle-query-parent</artifactId>
-		<version>0.3.0</version>
-        <relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<artifactId>eagle-common</artifactId>
-	<packaging>jar</packaging>
-	<name>eagle-common</name>
-
-	<dependencies>
-		<dependency>
-			<groupId>commons-configuration</groupId>
-			<artifactId>commons-configuration</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.hbase</groupId>
-			<artifactId>hbase-client</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.hadoop</groupId>
-			<artifactId>hadoop-common</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>javax.mail</groupId>
-			<artifactId>mail</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.velocity</groupId>
-			<artifactId>velocity</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>com.google.code.gson</groupId>
-			<artifactId>gson</artifactId>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.google.guava</groupId>
-			<artifactId>guava</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>com.netflix.archaius</groupId>
-			<artifactId>archaius-core</artifactId>
-		</dependency>
-		
-		<dependency>
-			<groupId>org.mortbay.jetty</groupId>
-			<artifactId>jetty</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.mortbay.jetty</groupId>
-			<artifactId>jetty-util</artifactId>
-		</dependency>
-        <dependency>
-            <groupId>com.typesafe</groupId>
-            <artifactId>config</artifactId>
-        </dependency>
-	</dependencies>
-</project>
-

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-common/src/main/java/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/META-INF/MANIFEST.MF b/eagle-core/eagle-query/eagle-common/src/main/java/META-INF/MANIFEST.MF
deleted file mode 100644
index c67816b..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-Manifest-Version: 1.0
-Class-Path: 
-

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/Base64.java b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
deleted file mode 100644
index aec84a3..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * 
- */
-package org.apache.eagle.common;
-
-import java.io.UnsupportedEncodingException;
-
-import javax.xml.bind.DatatypeConverter;
-
-public class Base64 {
-
-	public static String decode(String salted) {
-		try {
-			return new String(DatatypeConverter.parseBase64Binary(salted), "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("UTF-8 must be supported", e);
-		}
-	}
-
-	public static String encode(String plain) {
-		try {
-			return DatatypeConverter.printBase64Binary(plain.getBytes("UTF-8"));
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("UTF-8 must be supported", e);
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
deleted file mode 100644
index c1d4976..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-public class ByteUtil {
-	
-	public static double bytesToDouble(byte[] bytes, int offset){
-		return Double.longBitsToDouble(bytesToLong(bytes, offset));
-	}
-	
-	public static double bytesToDouble(byte[] bytes){
-		return Double.longBitsToDouble(bytesToLong(bytes));
-	}
-	
-	public static void doubleToBytes(double v, byte[] bytes){
-		doubleToBytes(v, bytes, 0);
-	}
-	
-	public static void doubleToBytes(double v, byte[] bytes, int offset){
-		longToBytes(Double.doubleToLongBits(v), bytes, offset);
-	}
-	
-	public static byte[] doubleToBytes(double v){
-		return longToBytes(Double.doubleToLongBits(v));
-	}
-	
-	public static long bytesToLong(byte[] bytes){
-		return bytesToLong(bytes, 0);
-	}
-	
-	public static long bytesToLong(byte[] bytes, int offset){
-		long value = 0;
-		for(int i=0; i<8; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void longToBytes(long v, byte[] bytes){
-		longToBytes(v, bytes, 0);
-	}
-	
-	public static void longToBytes(long v, byte[] bytes, int offset){
-		long tmp = v;
-		for(int i=0; i<8; i++){
-			bytes[offset + 7 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-	
-	public static byte[] longToBytes(long v){
-		long tmp = v;
-		byte[] b = new byte[8];
-		for(int i=0; i<8; i++){
-			b[7-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-	
-	public static int bytesToInt(byte[] bytes){
-		return bytesToInt(bytes, 0);
-	}
-	
-	public static int bytesToInt(byte[] bytes, int offset){
-		int value = 0;
-		for(int i=0; i<4; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void intToBytes(int v, byte[] bytes){
-		intToBytes(v, bytes, 0);
-	}
-	
-	public static void intToBytes(int v, byte[] bytes, int offset){
-		int tmp = v;
-		for(int i=0; i<4; i++){
-			bytes[offset + 3 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-
-	public static byte[] intToBytes(int v){
-		int tmp = v;
-		byte[] b = new byte[4];
-		for(int i=0; i<4; i++){
-			b[3-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-
-	//////
-	
-	public static short bytesToShort(byte[] bytes){
-		return bytesToShort(bytes, 0);
-	}
-	
-	public static short bytesToShort(byte[] bytes, int offset){
-		short value = 0;
-		for(int i=0; i < 2; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void shortToBytes(short v, byte[] bytes){
-		shortToBytes(v, bytes, 0);
-	}
-	
-	public static void shortToBytes(short v, byte[] bytes, int offset){
-		int tmp = v;
-		for(int i=0; i < 2; i++){
-			bytes[offset + 1 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-
-	public static byte[] shortToBytes(short v){
-		int tmp = v;
-		byte[] b = new byte[2];
-		for(int i=0; i<2; i++){
-			b[1-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-
-	public static byte[] concat(byte[]... arrays) {
-        int length = 0;
-        for (byte[] array : arrays) {
-            length += array.length;
-        }
-        byte[] result = new byte[length];
-        int pos = 0;
-        for (byte[] array : arrays) {
-            System.arraycopy(array, 0, result, pos, array.length);
-            pos += array.length;
-        }
-        return result;
-    }
-	
-//    public static void main(String[] args){ 
-//    	int a = "ThreadName".hashCode();
-//    	byte[] b = intToBytes(a);
-//    	byte[] c = intToBytes(1676687583);
-//    	String s = new String(b);
-//    	System.out.println(s);
-    	
-//    	byte[] d = intToBytes(8652353);
-//    	System.out.println(bytesToInt(d));
-    	
-//    	byte[] e = longToBytes(12131513513l);
-//    	System.out.println(bytesToLong(e));
-//    	if(12131513513l == bytesToLong(e)){
-//    		System.out.println("yes");
-//    	}
-//    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java b/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
deleted file mode 100644
index 49695e5..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-import java.util.AbstractList;
-import java.util.RandomAccess;
-
-/**
- * Circular array implementation
- *
- * @param <E>
- */
-public class CircularArrayList<E> extends AbstractList<E> implements RandomAccess {
-  
-    private final E[] buf; // a List implementing RandomAccess
-    private int head = 0;
-    private int tail = 0;
-    private boolean full = false;
-  
-    public CircularArrayList(E[] array) {
-        buf = array;
-        full = (buf.length == 0);
-    }
-  
-    public int capacity() {
-        return buf.length;
-    }
-    
-    public int head() {
-    	return head;
-    }
-    
-    public int tail() {
-    	return tail;
-    }
-    
-    public boolean isFull() {
-    	return full;
-    }
-    
-    @Override
-    public void clear() {
-        head = 0;
-        tail = 0;
-        full = false;
-        for (int i = 0; i < buf.length; ++i) {
-        	buf[i] = null;
-        }
-    }
-
-    private int wrapIndex(int i) {
-        int m = i % buf.length;
-        if (m < 0) { // java modulus can be negative
-            throw new IndexOutOfBoundsException();
-        }
-        return m;
-    }
-  
-    // This method is O(n) but will never be called if the
-    // CircularArrayList is used in its typical/intended role.
-    private void shiftBlock(int startIndex, int endIndex) {
-        assert (endIndex > startIndex);
-        for (int i = endIndex - 1; i >= startIndex; i--) {
-            set(i + 1, get(i));
-        }
-    }
-    
-    public int find(E e) {
-    	final int size = size();
-    	for (int i = 0; i < size; ++i) {
-    		if (e.equals(get(i))) {
-    			return i;
-    		}
-    	}
-    	return -1;
-    }
-  
-    @Override
-    public int size() {
-    	if (full) {
-    		return buf.length;
-    	}
-        return tail - head + (tail < head ? buf.length : 0);
-    }
-  
-    @Override
-    public E get(int i) {
-        if (i < 0 || i >= size()) {
-            throw new IndexOutOfBoundsException();
-        }
-        return buf[wrapIndex(head + i)];
-    }
-  
-    @Override
-    public E set(int i, E e) {
-        if (i < 0 || i >= size()) {
-            throw new IndexOutOfBoundsException();
-        }
-        return buf[wrapIndex(head + i)] =  e;
-    }
-  
-    @Override
-    public void add(int i, E e) {
-        int s = size();
-        if (s == buf.length) {
-            throw new IllegalStateException("Cannot add element."
-                    + " CircularArrayList is filled to capacity.");
-        }
-        full = (s + 1 == buf.length);
-        if (i < 0 || i > s) {
-            throw new IndexOutOfBoundsException();
-        }
-        tail = wrapIndex(tail + 1);
-        if (i < s) {
-            shiftBlock(i, s);
-        }
-        set(i, e);
-    }
-  
-    @Override
-    public E remove(int i) {
-        int s = size();
-        if (i < 0 || i >= s) {
-            throw new IndexOutOfBoundsException();
-        }
-        final E e = get(i);
-        if (i > 0) {
-            shiftBlock(0, i);
-        }
-    	buf[head] = null;
-        head = wrapIndex(head + 1);
-        full = false;
-        return e;
-    }
-}
\ No newline at end of file


Mime
View raw message