eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [16/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:49 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/QueryConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/QueryConstants.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/QueryConstants.java
deleted file mode 100644
index 231cc99..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/QueryConstants.java
+++ /dev/null
@@ -1,24 +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.query;
-
-/**
- * @since 3/25/15
- */
-public class QueryConstants {
-    public final static String CHARSET ="UTF-8";
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntity.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntity.java
deleted file mode 100644
index 1f3214f..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntity.java
+++ /dev/null
@@ -1,69 +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.query.aggregate;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
-public class AggregateAPIEntity {
-	private long numDirectDescendants;
-	private long numTotalDescendants;
-	private String key;
-	private SortedMap<String, AggregateAPIEntity> entityList = new TreeMap<String, AggregateAPIEntity>();
-	private List<AggregateAPIEntity> sortedList = new ArrayList<AggregateAPIEntity>();
-
-	public String getKey() {
-		return key;
-	}
-	public void setKey(String key) {
-		this.key = key;
-	}
-	@JsonProperty("sL")
-	public List<AggregateAPIEntity> getSortedList() {
-		return sortedList;
-	}
-	public void setSortedList(List<AggregateAPIEntity> sortedList) {
-		this.sortedList = sortedList;
-	}
-	@JsonProperty("eL")
-	public SortedMap<String, AggregateAPIEntity> getEntityList() {
-		return entityList;
-	}
-	public void setEntityList(SortedMap<String, AggregateAPIEntity> entityList) {
-		this.entityList = entityList;
-	}
-	@JsonProperty("nDD")
-	public long getNumDirectDescendants() {
-		return numDirectDescendants;
-	}
-	public void setNumDirectDescendants(long numDirectDescendants) {
-		this.numDirectDescendants = numDirectDescendants;
-	}
-	@JsonProperty("nTD")
-	public long getNumTotalDescendants() {
-		return numTotalDescendants;
-	}
-	public void setNumTotalDescendants(long numTotalDescendants) {
-		this.numTotalDescendants = numTotalDescendants;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntityFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntityFactory.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntityFactory.java
deleted file mode 100644
index 8e18b39..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateAPIEntityFactory.java
+++ /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.
- */
-package org.apache.eagle.query.aggregate;
-
-public interface AggregateAPIEntityFactory {
-	public AggregateAPIEntity create();
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateCondition.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateCondition.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateCondition.java
deleted file mode 100755
index 5555cfd..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateCondition.java
+++ /dev/null
@@ -1,73 +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.query.aggregate;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *
- * @since : 11/7/14,2014
- */
-public class AggregateCondition implements Serializable{
-	private static final long serialVersionUID = 1L;
-	private List<String> groupbyFields;
-	private List<AggregateFunctionType> aggregateFunctionTypes;
-	private List<String> aggregateFields;
-	private boolean timeSeries;
-	private long intervalMS;
-
-	public List<String> getGroupbyFields() {
-		return groupbyFields;
-	}
-
-	public void setGroupbyFields(List<String> groupbyFields) {
-		this.groupbyFields = groupbyFields;
-	}
-
-	public List<AggregateFunctionType> getAggregateFunctionTypes() {
-		return aggregateFunctionTypes;
-	}
-
-	public void setAggregateFunctionTypes(List<AggregateFunctionType> aggregateFunctionTypes) {
-		this.aggregateFunctionTypes = aggregateFunctionTypes;
-	}
-
-	public List<String> getAggregateFields() {
-		return aggregateFields;
-	}
-
-	public void setAggregateFields(List<String> aggregateFields) {
-		this.aggregateFields = aggregateFields;
-	}
-
-	public boolean isTimeSeries() {
-		return timeSeries;
-	}
-
-	public void setTimeSeries(boolean timeSeries) {
-		this.timeSeries = timeSeries;
-	}
-
-	public long getIntervalMS() {
-		return intervalMS;
-	}
-
-	public void setIntervalMS(long intervalMS) {
-		this.intervalMS = intervalMS;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionNotSupportedException.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionNotSupportedException.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionNotSupportedException.java
deleted file mode 100644
index df35c8b..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionNotSupportedException.java
+++ /dev/null
@@ -1,28 +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.query.aggregate;
-
-public class AggregateFunctionNotSupportedException extends RuntimeException{
-	static final long serialVersionUID = -4548788354899625887L;
-	public AggregateFunctionNotSupportedException(){
-		super();
-	}
-	
-	public AggregateFunctionNotSupportedException(String message){
-		super(message);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionType.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionType.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionType.java
deleted file mode 100755
index 8ac3b8c..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionType.java
+++ /dev/null
@@ -1,85 +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.query.aggregate;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public enum AggregateFunctionType{
-	count("^(count)$"),
-	sum("^sum\\((.*)\\)$"),
-	avg("^avg\\((.*)\\)$"),
-	max("^max\\((.*)\\)$"),
-	min("^min\\((.*)\\)$");
-	
-	private Pattern pattern;
-	private AggregateFunctionType(String patternString){
-		this.pattern = Pattern.compile(patternString);
-	}
-
-	/**
-	 * This method is thread safe
-	 * match and retrieve back the aggregated fields, for count, aggregateFields can be null
-	 * @param function
-	 * @return
-	 */
-	public AggregateFunctionTypeMatcher matcher(String function){
-		Matcher m = pattern.matcher(function);
-
-		if(m.find()){
-			return new AggregateFunctionTypeMatcher(this, true, m.group(1));
-		}else{
-			return new AggregateFunctionTypeMatcher(this, false, null);
-		}
-	}
-
-	public static AggregateFunctionTypeMatcher matchAll(String function){
-		for(AggregateFunctionType type : values()){
-			Matcher m = type.pattern.matcher(function);
-			if(m.find()){
-				return new AggregateFunctionTypeMatcher(type, true, m.group(1));
-			}
-		}
-		return new AggregateFunctionTypeMatcher(null, false, null);
-	}
-
-	public static byte[] serialize(AggregateFunctionType type){
-		return type.name().getBytes();
-	}
-
-	public static AggregateFunctionType deserialize(byte[] type){
-		return valueOf(new String(type));
-	}
-
-	public static List<byte[]> toBytesList(List<AggregateFunctionType> types){
-		List<byte[]> result = new ArrayList<byte[]>();
-		for(AggregateFunctionType type:types){
-			result.add(serialize(type));
-		}
-		return result;
-	}
-
-	public static List<AggregateFunctionType> fromBytesList(List<byte[]> types){
-		List<AggregateFunctionType> result = new ArrayList<AggregateFunctionType>();
-		for(byte[] bs:types){
-			result.add(deserialize(bs));
-		}
-		return result;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionTypeMatcher.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionTypeMatcher.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionTypeMatcher.java
deleted file mode 100644
index 6b2bc13..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateFunctionTypeMatcher.java
+++ /dev/null
@@ -1,41 +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.query.aggregate;
-
-public class AggregateFunctionTypeMatcher {
-	private final AggregateFunctionType type;
-	private final boolean matched;
-	private final String field;
-
-	public AggregateFunctionTypeMatcher(AggregateFunctionType type, boolean matched, String field){
-		this.type = type;
-		this.matched = matched;
-		this.field = field;
-	}
-	
-	public boolean find(){
-		return this.matched;
-	}
-	
-	public String field(){
-		return this.field;
-	}
-	
-	public AggregateFunctionType type(){
-		return this.type;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParams.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParams.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParams.java
deleted file mode 100644
index 616184d..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParams.java
+++ /dev/null
@@ -1,77 +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.query.aggregate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class AggregateParams{
-	List<String> groupbyFields;
-	boolean counting;
-	List<String> sumFunctionFields = new ArrayList<String>();
-	List<SortFieldOrder> sortFieldOrders = new ArrayList<SortFieldOrder>();
-	
-	public List<SortFieldOrder> getSortFieldOrders() {
-		return sortFieldOrders;
-	}
-	public void setSortFieldOrders(List<SortFieldOrder> sortFieldOrders) {
-		this.sortFieldOrders = sortFieldOrders;
-	}
-	public List<String> getGroupbyFields() {
-		return groupbyFields;
-	}
-	public void setGroupbyFields(List<String> groupbyFields) {
-		this.groupbyFields = groupbyFields;
-	}
-	public boolean isCounting() {
-		return counting;
-	}
-	public void setCounting(boolean counting) {
-		this.counting = counting;
-	}
-	public List<String> getSumFunctionFields() {
-		return sumFunctionFields;
-	}
-	public void setSumFunctionFields(List<String> sumFunctionFields) {
-		this.sumFunctionFields = sumFunctionFields;
-	}
-
-	public static class SortFieldOrder{
-		public static final String SORT_BY_AGGREGATE_KEY = "key";
-		public static final String SORT_BY_COUNT = "count";
-		private String field;
-		private boolean ascendant;
-		
-		public SortFieldOrder(String field, boolean ascendant) {
-			super();
-			this.field = field;
-			this.ascendant = ascendant;
-		}
-		public String getField() {
-			return field;
-		}
-		public void setField(String field) {
-			this.field = field;
-		}
-		public boolean isAscendant() {
-			return ascendant;
-		}
-		public void setAscendant(boolean ascendant) {
-			this.ascendant = ascendant;
-		} 
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParamsValidator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParamsValidator.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParamsValidator.java
deleted file mode 100644
index 9500574..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateParamsValidator.java
+++ /dev/null
@@ -1,94 +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.query.aggregate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class AggregateParamsValidator {
-	/**
-	 * This method handle the following sytle syntax
-	 * sum(numConfiguredMapSlots), count group by cluster, rack 
-	 * 1. ensure that all gb fields must occur in outputField or outputTag
-	 * 2. ensure that all summarized fields must occur in outputField, 
-	 *    for example, for function=sum(numConfiguredMapSlots), numConfiguredMapSlots must occur in outputField  
-	 * 3. groupby should be pre-appended with a root groupby field  
-	 * @param outputTags
-	 * @param outputFields
-	 * @param groupbys
-	 * @param functions
-	 * @throws IllegalArgumentException
-	 */
-	public static AggregateParams compileAggregateParams(List<String> outputTags, List<String> outputFields, List<String> groupbys, List<String> functions, List<String> sortFieldOrders)
-			throws IllegalArgumentException, AggregateFunctionNotSupportedException{
-		AggregateParams aggParams = new AggregateParams();
-		// ensure that all gb fields must occur in outputField or outputTag
-		for(String groupby : groupbys){
-			if(!outputTags.contains(groupby) && !outputFields.contains(groupby)){
-				throw new IllegalArgumentException(groupby + ", All gb fields should appear in outputField list or outputTag list");
-			}
-		}
-		
-		// parse functions and ensure that all summarized fields must occur in outputField
-		for(String function : functions){
-			AggregateFunctionTypeMatcher m = AggregateFunctionType.count.matcher(function);
-			if(m.find()){
-				aggParams.setCounting(true);
-				continue;
-			}
-
-			m = AggregateFunctionType.sum.matcher(function);
-			if(m.find()){
-				if(!outputFields.contains(m.field())){
-					throw new IllegalArgumentException(m.field() + ", All summary function fields should appear in outputField list");
-				}
-				aggParams.getSumFunctionFields().add(m.field());
-				continue;
-			}
-			
-			throw new AggregateFunctionNotSupportedException("function " + function + " is not supported, only count, sum aggregate functions are now supported");
-		}
-		
-		//  groupby should be pre-appended with a root groupby field
-		List<String> groupbyFields = new ArrayList<String>();
-		groupbyFields.add(Aggregator.GROUPBY_ROOT_FIELD_NAME);
-		groupbyFields.addAll(groupbys);
-		aggParams.setGroupbyFields(groupbyFields);
-
-		// check sort field orders
-		boolean byKeySorting = false;
-		for(String sortFieldOrder : sortFieldOrders){
-			AggregateParams.SortFieldOrder sfo = SortFieldOrderType.matchAll(sortFieldOrder);
-			if(sfo == null){
-				throw new IllegalArgumentException(sortFieldOrder + ", All sort field order should be <field>=(asc|desc)");
-			}
-			if(sfo.getField().equals(AggregateParams.SortFieldOrder.SORT_BY_AGGREGATE_KEY)){
-				byKeySorting =  true;
-			}else if(!sfo.getField().equals(AggregateParams.SortFieldOrder.SORT_BY_COUNT)){
-				if(!groupbys.contains(sfo.getField()) && !aggParams.getSumFunctionFields().contains(sfo.getField())){
-					throw new IllegalArgumentException(sortFieldOrder + ", All sort field order should appear in gb or function fields");
-				}
-			}
-			aggParams.getSortFieldOrders().add(sfo);
-		}
-		// always add key ascendant to the last aggregation key if not specified
-		if(!byKeySorting){
-			aggParams.getSortFieldOrders().add(new AggregateParams.SortFieldOrder(AggregateParams.SortFieldOrder.SORT_BY_AGGREGATE_KEY, true));
-		}
-		return aggParams;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateResultAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateResultAPIEntity.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateResultAPIEntity.java
deleted file mode 100644
index c1c87d3..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/AggregateResultAPIEntity.java
+++ /dev/null
@@ -1,52 +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.query.aggregate;
-
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
-public class AggregateResultAPIEntity {
-	private boolean success;
-	private String exception;
-	private long elapsedms;
-	private AggregateAPIEntity entity;
-
-	public long getElapsedms() {
-		return elapsedms;
-	}
-	public void setElapsedms(long elapsedms) {
-		this.elapsedms = elapsedms;
-	}
-	public AggregateAPIEntity getEntity() {
-		return entity;
-	}
-	public void setEntity(AggregateAPIEntity entity) {
-		this.entity = entity;
-	}
-	public boolean isSuccess() {
-		return success;
-	}
-	public void setSuccess(boolean success) {
-		this.success = success;
-	}
-	public String getException() {
-		return exception;
-	}
-	public void setException(String exception) {
-		this.exception = exception;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/Aggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/Aggregator.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/Aggregator.java
deleted file mode 100644
index de911e5..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/Aggregator.java
+++ /dev/null
@@ -1,168 +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.query.aggregate;
-
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-
-public class Aggregator {
-	private static final Logger LOG = LoggerFactory.getLogger(Aggregator.class);
-	public static final String GROUPBY_ROOT_FIELD_NAME = "site";
-	public static final String GROUPBY_ROOT_FIELD_VALUE = "xyz";
-	public static final String UNASSIGNED_GROUPBY_ROOT_FIELD_NAME = "unassigned";
-	
-	private final AggregateAPIEntityFactory factory;
-	private final AggregateAPIEntity root;
-	private final List<String> groupbys;
-	private final List<String> sumFunctionFields;
-	private final boolean counting;
-	
-	public Aggregator(AggregateAPIEntityFactory factory, AggregateAPIEntity root, List<String> groupbys, boolean counting, List<String> sumFunctionFields){
-		this.factory = factory;
-		this.root = root;
-		this.groupbys = groupbys;
-		this.sumFunctionFields = sumFunctionFields;
-		this.counting = counting;
-	}
-
-	/**
-	 * this locate result can be cached? we don't need check if it's TaggedLogAPIEntity each time when iterating entities
-	 * @param groupby
-	 * @param obj
-	 * @return
-	 * @throws Exception
-	 */
-	private String locateGroupbyField(String groupby, TaggedLogAPIEntity obj){
-		if(groupby.equals(GROUPBY_ROOT_FIELD_NAME)){
-			return GROUPBY_ROOT_FIELD_VALUE;
-		}
-		// check tag first
-		String tagv = obj.getTags().get(groupby);
-		if(tagv != null)
-			return tagv;
-		// check against pojo, or qualifierValues
-		String fn = groupby.substring(0,1).toUpperCase()+groupby.substring(1, groupby.length());
-		try{
-			Method getM = obj.getClass().getMethod("get"+fn);
-			Object value = getM.invoke(obj);
-			return (String)value;
-		}catch(Exception ex){
-			LOG.warn(groupby + " field is in neither tags nor fields, " + ex.getMessage());
-			return null;
-		}
-	}
-	
-	/**
-	 * accumulate a list of entities
-	 * @param entities
-	 * @throws Exception
-	 */
-	public void accumulateAll(List<TaggedLogAPIEntity> entities) throws Exception{
-		for(TaggedLogAPIEntity entity : entities){
-			accumulate(entity);
-		}
-	}
-	
-	/**
-	 * currently only group by tags
-	 * groupbys' first item always is site, which is a reserved field 
-	 */
-	public void accumulate(TaggedLogAPIEntity entity) throws Exception{
-		AggregateAPIEntity current = root;
-		for(String groupby : groupbys){
-			// TODO tagv is empty, so what to do? use a reserved field_name "unassigned" ?
-			// TODO we should support all Pojo with java bean style object
-			String tagv = locateGroupbyField(groupby, entity);
-			if(tagv == null || tagv.isEmpty()){
-				tagv = UNASSIGNED_GROUPBY_ROOT_FIELD_NAME;
-			}
-			Map<String, AggregateAPIEntity> children = current.getEntityList();
-			if(children.get(tagv) == null){
-				children.put(tagv, factory.create());
-				current.setNumDirectDescendants(current.getNumDirectDescendants()+1);
-			}
-			AggregateAPIEntity child = children.get(tagv);
-			// go through all aggregate functions including count, summary etc.			
-			if(counting)
-				count(child);
-			for(String sumFunctionField : sumFunctionFields){
-				sum(child, entity, sumFunctionField);
-			}
-			
-			current = child;
-		}
-		
-	}
-
-	
-	/**
-	 * use java bean specifications?
-	 * reflection is not efficient, let us find out solutions
-	 */
-	private void sum(Object targetObj, TaggedLogAPIEntity srcObj, String fieldName) throws Exception{
-		try{
-			String fn = fieldName.substring(0,1).toUpperCase()+fieldName.substring(1, fieldName.length());
-			Method srcGetMethod = srcObj.getClass().getMethod("get"+fn);
-			Object srcValue = srcGetMethod.invoke(srcObj);
-			if(srcValue == null){
-				return;  // silently don't count this source object
-			}
-			Method targetGetMethod = targetObj.getClass().getMethod("get"+fn);
-			Object targetValue = targetGetMethod.invoke(targetObj);
-			if(targetValue instanceof Long){
-				Method setM = targetObj.getClass().getMethod("set"+fn, long.class);
-				Long tmp1 = (Long)targetValue;
-				// TODO, now source object always have type "java.lang.String", later on we should support various type including integer type
-				Long tmp2 = null;
-				if(srcValue instanceof String){
-					tmp2 = Long.valueOf((String)srcValue);
-				}else if(srcValue instanceof Long){
-					tmp2 = (Long)srcValue;
-				}else{
-					throw new IllegalAggregateFieldTypeException(srcValue.getClass().toString() + " type is not support. The source type must be Long or String");
-				}
-				setM.invoke(targetObj, tmp1.longValue()+tmp2.longValue());
-			}else if(targetValue instanceof Double){
-				Method setM = targetObj.getClass().getMethod("set"+fn, double.class);
-				Double tmp1 = (Double)targetValue;
-				String src = (String) srcValue;
-				Double tmp2 = Double.valueOf(src);
-				setM.invoke(targetObj, tmp1.doubleValue()+tmp2.doubleValue());
-			}else{
-				throw new IllegalAggregateFieldTypeException(targetValue.getClass().toString() + " type is not support. The target type must be long or double");
-			}
-		}catch(Exception ex){
-			LOG.error("Cannot do sum aggregation for field " + fieldName, ex);
-			throw ex;
-		}
-	}
-	
-	/**
-	 * count possible not only count for number of descendants but also count for not-null fields 
-	 * @param targetObj
-	 * @throws Exception
-	 */
-	private void count(AggregateAPIEntity targetObj) throws Exception{
-		targetObj.setNumTotalDescendants(targetObj.getNumTotalDescendants()+1);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/BucketQuery.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/BucketQuery.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/BucketQuery.java
deleted file mode 100644
index a00c5ad..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/BucketQuery.java
+++ /dev/null
@@ -1,84 +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.query.aggregate;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
-
-public class BucketQuery {
-	public final static String UNASSIGNED_BUCKET = "unassigned"; 
-	private List<String> bucketFields;
-	private int limit;
-	private Map<String, Object> root = new HashMap<String, Object>();
-	
-	public BucketQuery(List<String> bucketFields, int limit){
-		this.bucketFields = bucketFields;
-		this.limit = limit;
-	}
-	
-	@SuppressWarnings("unchecked")
-	public void put(TaggedLogAPIEntity entity){
-		Map<String, Object> current = root;
-		int bucketCount = bucketFields.size();
-		if(bucketCount <= 0)
-			return; // silently return
-		int i = 0;
-		String bucketFieldValue = null;
-		for(; i<bucketCount; i++){
-			String bucketField = bucketFields.get(i);
-			bucketFieldValue = entity.getTags().get(bucketField);
-			if(bucketFieldValue == null || bucketFieldValue.isEmpty()){
-				bucketFieldValue = UNASSIGNED_BUCKET;
-			}
-			// for last bucket, bypass the following logic
-			if(i == bucketCount-1){
-				break;
-			}
-				
-			if(current.get(bucketFieldValue) == null){
-				current.put(bucketFieldValue, new HashMap<String, Object>());
-			}
-			// for the last level of bucket, it is not Map, instead it is List<TaggedLogAPIEntity> 
-			current = (Map<String, Object>)current.get(bucketFieldValue);
-		}
-		List<TaggedLogAPIEntity> bucketContent = (List<TaggedLogAPIEntity>)current.get(bucketFieldValue);
-		if(bucketContent == null){
-			bucketContent = new ArrayList<TaggedLogAPIEntity>();
-			current.put(bucketFieldValue, bucketContent);
-		}
-		
-		if(bucketContent.size() >= limit){
-			return;
-		}else{
-			bucketContent.add(entity);
-		}
-	}
-	
-	public void batchPut(List<TaggedLogAPIEntity> entities){
-		for(TaggedLogAPIEntity entity : entities){
-			put(entity);
-		}
-	}
-	
-	public Map<String, Object> get(){
-		return root;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/IllegalAggregateFieldTypeException.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/IllegalAggregateFieldTypeException.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/IllegalAggregateFieldTypeException.java
deleted file mode 100644
index 3e3e739..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/IllegalAggregateFieldTypeException.java
+++ /dev/null
@@ -1,28 +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.query.aggregate;
-
-public class IllegalAggregateFieldTypeException extends RuntimeException{
-	static final long serialVersionUID = -4548788354899625887L;
-	public IllegalAggregateFieldTypeException(){
-		super();
-	}
-	
-	public IllegalAggregateFieldTypeException(String message){
-		super(message + ", only count and sum are support");
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/PostAggregateSorting.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/PostAggregateSorting.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/PostAggregateSorting.java
deleted file mode 100644
index b801255..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/PostAggregateSorting.java
+++ /dev/null
@@ -1,101 +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.query.aggregate;
-
-import java.lang.reflect.Method;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PostAggregateSorting {
-	private static final Logger LOG = LoggerFactory.getLogger(PostAggregateSorting.class);
-	
-	private static SortedSet<Map.Entry<String, AggregateAPIEntity>> sortByValue(Map<String, AggregateAPIEntity> map, List<AggregateParams.SortFieldOrder> sortedFields) {
-	    SortedSet<Map.Entry<String, AggregateAPIEntity>> sortedEntries = new TreeSet<Map.Entry<String, AggregateAPIEntity>>(new MapKeyValueComparator(sortedFields));
-	    sortedEntries.addAll(map.entrySet());
-	    return sortedEntries;
-	}
-
-	/**
-	 * recursively populate sorted list from entity list
-	 * @param entity
-	 */
-	public static void sort(AggregateAPIEntity entity, List<AggregateParams.SortFieldOrder> sortFieldOrders){
-		// sort should internally add key field to AggregateAPIEntity before the sorting starts as "key" could be sorted against
-		Map<String, AggregateAPIEntity> children = entity.getEntityList();
-		for(Map.Entry<String, AggregateAPIEntity> e : children.entrySet()){
-			e.getValue().setKey(e.getKey());
-		}
-		SortedSet<Map.Entry<String, AggregateAPIEntity>> set = sortByValue(children, sortFieldOrders);
-		for(Map.Entry<String, AggregateAPIEntity> entry : set){
-			entity.getSortedList().add(entry.getValue());
-		}
-		for(Map.Entry<String, AggregateAPIEntity> entry : entity.getEntityList().entrySet()){
-			sort(entry.getValue(), sortFieldOrders);
-		}
-		entity.setEntityList(null);
-	}
-
-	private static class MapKeyValueComparator implements Comparator<Map.Entry<String, AggregateAPIEntity>>{
-		private List<AggregateParams.SortFieldOrder> sortedFieldOrders;
-		public MapKeyValueComparator(List<AggregateParams.SortFieldOrder> sortedFields){
-			this.sortedFieldOrders = sortedFields;
-		}
-		@Override
-        public int compare(Map.Entry<String, AggregateAPIEntity> e1, Map.Entry<String, AggregateAPIEntity> e2){
-			int r = 0;
-			AggregateAPIEntity entity1 = e1.getValue();
-			AggregateAPIEntity entity2 = e2.getValue();
-            for(AggregateParams.SortFieldOrder sortFieldOrder : sortedFieldOrders){
-            	// TODO count should not be literal, compare numTotalDescendants
-            	if(sortFieldOrder.getField().equals(AggregateParams.SortFieldOrder.SORT_BY_COUNT)){
-            		long tmp = entity1.getNumTotalDescendants() - entity2.getNumTotalDescendants();
-            		r = (tmp == 0) ? 0 : ((tmp > 0) ? 1 : -1);
-            	}else if(sortFieldOrder.getField().equals(AggregateParams.SortFieldOrder.SORT_BY_AGGREGATE_KEY)){
-            		r = entity1.getKey().compareTo(entity2.getKey());
-            	}else{
-            		try{
-	            		String sortedField = sortFieldOrder.getField();
-	            		String tmp1 = sortedField.substring(0, 1).toUpperCase()+sortedField.substring(1);
-	            		Method getMethod1 = entity1.getClass().getMethod("get"+tmp1);
-	            		Object r1 = getMethod1.invoke(entity1);
-	            		Long comp1 = (Long)r1;
-	            		String tmp2 = sortedField.substring(0, 1).toUpperCase()+sortedField.substring(1);
-	            		Method getMethod2 = entity2.getClass().getMethod("get"+tmp2);
-	            		Object r2 = getMethod2.invoke(entity2);
-	            		Long comp2 = (Long)r2;
-	            		r = comp1.compareTo(comp2);
-            		}catch(Exception ex){
-            			LOG.error("Can not get corresponding field for sorting", ex);
-            			r = 0;
-            		}
-            	}
-            	if(r == 0) continue;
-        		if(!sortFieldOrder.isAscendant()){
-        			r = -r;
-        		}
-    			return r;
-            }	
-			return r;
-        }
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderType.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderType.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderType.java
deleted file mode 100644
index 6d47c7f..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderType.java
+++ /dev/null
@@ -1,59 +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.query.aggregate;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public enum SortFieldOrderType {
-	key("^(key)=(asc|desc)$"),
-	count("^(count)=(asc|desc)$"),
-	sum("^sum\\((.*)\\)=(asc|desc)$"),
-	avg("^avg\\((.*)\\)(asc|desc)$"),
-	max("^max\\((.*)\\)(asc|desc)$"),
-	min("^min\\((.*)\\)(asc|desc)$");
-	
-	private Pattern pattern;
-	private SortFieldOrderType(String patternString){
-		this.pattern = Pattern.compile(patternString);
-	}
-
-	/**
-	 * This method is thread safe
-	 * match and retrieve back the aggregated fields, for count, aggregateFields can be null
-	 * @param sortFieldOrder
-	 * @return
-	 */
-	public SortFieldOrderTypeMatcher matcher(String sortFieldOrder){
-		Matcher m = pattern.matcher(sortFieldOrder);
-		
-		if(m.find()){
-			return new SortFieldOrderTypeMatcher(true, m.group(1), m.group(2));
-		}else{
-			return new SortFieldOrderTypeMatcher(false, null, null);
-		}
-	}
-	
-	public static AggregateParams.SortFieldOrder matchAll(String sortFieldOrder){
-		for(SortFieldOrderType type : SortFieldOrderType.values()){
-			SortFieldOrderTypeMatcher m = type.matcher(sortFieldOrder);
-			if(m.find())
-				return m.sortFieldOrder();
-		}
-		return null;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderTypeMatcher.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderTypeMatcher.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderTypeMatcher.java
deleted file mode 100644
index 0b4d408..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/SortFieldOrderTypeMatcher.java
+++ /dev/null
@@ -1,38 +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.query.aggregate;
-
-
-public class SortFieldOrderTypeMatcher {
-	private boolean matched;
-	private AggregateParams.SortFieldOrder sortFieldOrder;
-
-	public SortFieldOrderTypeMatcher(boolean matched, String field, String order){
-		this.matched = matched;
-		if(matched){
-			this.sortFieldOrder = new AggregateParams.SortFieldOrder(field, order.equals("asc"));
-		}
-	}
-	
-	public boolean find(){
-		return this.matched;
-	}
-	
-	public AggregateParams.SortFieldOrder sortFieldOrder(){
-		return this.sortFieldOrder;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/Function.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/Function.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/Function.java
deleted file mode 100755
index 83c683c..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/Function.java
+++ /dev/null
@@ -1,106 +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.query.aggregate.raw;
-
-public abstract class Function{
-	private int count = 0;
-	protected void incrCount(int num){ count += num; }
-	public int count(){ return count; }
-	public abstract void run(double v,int count);
-	public void run(double v){ run(v,1); }
-	public abstract double result();
-
-	public static class Avg extends Function {
-		private double total;
-		public Avg(){
-			this.total = 0.0;
-		}
-		@Override
-		public void run(double v,int count){
-			this.incrCount(count);
-			total += v;
-		}
-		@Override
-		public double result(){
-			return this.total/this.count();
-		}
-	}
-
-	public static class Max extends Function {
-		private double maximum;
-		public Max(){
-			// TODO is this a bug, or only positive numeric calculation is supported
-			this.maximum = 0.0;
-		}
-
-		@Override
-		public void run(double v,int count){
-			this.incrCount(count);
-			if(v > maximum){
-				maximum = v;
-			}
-		}
-
-		@Override
-		public double result(){
-			return maximum;
-		}
-	}
-
-	public static class Min extends Function {
-		private double minimum;
-		public Min(){
-			// TODO is this a bug, or only positive numeric calculation is supported
-			this.minimum = Double.MAX_VALUE;
-		}
-		@Override
-		public void run(double v,int count){
-			this.incrCount(count);
-			if(v < minimum){
-				minimum = v;
-			}
-		}
-
-		@Override
-		public double result(){
-			return minimum;
-		}
-	}
-
-	public static class Sum extends Function {
-		private double summary;
-		public Sum(){
-			this.summary = 0.0;
-		}
-		@Override
-		public void run(double v,int count){
-			this.incrCount(count);
-			this.summary += v;
-		}
-
-		@Override
-		public double result(){
-			return this.summary;
-		}
-	}
-
-	public static class Count extends Sum{
-		public Count(){
-			super();
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/FunctionFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/FunctionFactory.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/FunctionFactory.java
deleted file mode 100755
index c6d1861..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/FunctionFactory.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.query.aggregate.raw;
-
-import org.apache.eagle.query.aggregate.AggregateFunctionType;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public abstract class FunctionFactory{
-	public abstract Function createFunction();
-
-	public static class AvgFactory extends FunctionFactory {
-		@Override
-		public Function createFunction(){
-			return new Function.Avg();
-		}
-	}
-
-	public static class MaxFactory extends FunctionFactory {
-		@Override
-		public Function createFunction(){
-			return new Function.Max();
-		}
-	}
-
-	public static class MinFactory extends FunctionFactory {
-		@Override
-		public Function createFunction(){
-			return new Function.Min();
-		}
-	}
-
-	public static class CountFactory extends FunctionFactory {
-		@Override
-		public Function createFunction(){
-			return new Function.Count();
-		}
-	}
-
-	public static class SumFactory extends FunctionFactory {
-		@Override
-		public Function createFunction(){
-			return new Function.Sum();
-		}
-	}
-
-	public static FunctionFactory locateFunctionFactory(AggregateFunctionType funcType){
-		return _functionFactories.get(funcType.name());
-	}
-
-	private static Map<String, FunctionFactory> _functionFactories = new HashMap<String, FunctionFactory>();
-	static{
-		_functionFactories.put(AggregateFunctionType.count.name(), new CountFactory());
-		_functionFactories.put(AggregateFunctionType.sum.name(), new SumFactory());
-		_functionFactories.put(AggregateFunctionType.min.name(), new MinFactory());
-		_functionFactories.put(AggregateFunctionType.max.name(), new MaxFactory());
-		_functionFactories.put(AggregateFunctionType.avg.name(), new AvgFactory());
-	}
-}
-	
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKey.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKey.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKey.java
deleted file mode 100755
index 3a54d70..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKey.java
+++ /dev/null
@@ -1,138 +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.query.aggregate.raw;
-
-import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.Writable;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * <h3>Structure</h3>
- * <pre>
- * {
- *   List[byte[],...]
- * }
- * </pre>
- */
-public class GroupbyKey implements Writable {
-	private final WritableList<BytesWritable> value;
-
-	public void addValue(byte[] value){
-		this.value.add(new BytesWritable(value));
-	}
-	public void addAll(List<BytesWritable> list){
-		this.value.addAll(list);
-	}
-
-	public List<BytesWritable> getValue(){
-		return value;
-	}
-
-	/**
-	 * empty constructor
-	 */
-	public GroupbyKey(){
-		this.value = new WritableList<BytesWritable>(BytesWritable.class);
-	}
-
-	/**
-	 * clear for reuse
-	 */
-	public void clear(){
-		value.clear();
-	}
-
-	/**
-	 * copy constructor
-	 * @param key
-	 */
-	public GroupbyKey(GroupbyKey key){
-		this();
-		ListIterator<BytesWritable> it = key.value.listIterator();
-//		ListIterator<byte[]> it = key.value.listIterator();
-		while(it.hasNext()){
-			this.value.add(it.next());
-		}
-	}
-
-	public GroupbyKey(List<byte[]> bytes){
-		this();
-		for(byte[] bt:bytes){
-			this.addValue(bt);
-		}
-	}
-
-	@Override
-	public boolean equals(Object obj){
-		if(obj == this)
-			return true;
-		if(!(obj instanceof GroupbyKey)){
-			return false;
-		}
-		GroupbyKey that = (GroupbyKey)obj;
-//		ListIterator<byte[]> e1 = this.value.listIterator();
-//		ListIterator<byte[]> e2 = that.value.listIterator();
-		ListIterator<BytesWritable> e1 = this.value.listIterator();
-		ListIterator<BytesWritable> e2 = that.value.listIterator();
-		while(e1.hasNext() && e2.hasNext()){
-			if(!Arrays.equals(e1.next().getBytes(), e2.next().getBytes()))
-				return false;
-		}
-		return !(e1.hasNext() || e2.hasNext());
-	}
-
-	@Override
-	public int hashCode(){
-		ListIterator<BytesWritable> e1 = this.value.listIterator();
-		int hash = 0xFFFFFFFF;
-		while(e1.hasNext()){
-			hash ^= Arrays.hashCode(e1.next().getBytes());
-		}
-		return hash;
-	}
-
-	/**
-	 * Serialize the fields of this object to <code>out</code>.
-	 *
-	 * @param out <code>DataOuput</code> to serialize this object into.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void write(DataOutput out) throws IOException {
-		this.value.write(out);
-	}
-
-	/**
-	 * Deserialize the fields of this object from <code>in</code>.
-	 * <p/>
-	 * <p>For efficiency, implementations should attempt to re-use storage in the
-	 * existing object where possible.</p>
-	 *
-	 * @param in <code>DataInput</code> to deseriablize this object from.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void readFields(DataInput in) throws IOException {
-		this.value.readFields(in);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyAggregatable.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyAggregatable.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyAggregatable.java
deleted file mode 100755
index 7e20029..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyAggregatable.java
+++ /dev/null
@@ -1,39 +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.query.aggregate.raw;
-
-import java.util.List;
-
-/**
- * The generic interface to unify the GroupbyKeyValue-based results of different 
- * business logic aggregates like RawAggregator or TimeSeriesAggregator
- *
- * @see org.apache.eagle.query.aggregate.timeseries.TimeSeriesAggregator
- * @see RawAggregator
- *
- * @since : 11/3/14,2014
- *
- */
-public interface GroupbyKeyAggregatable {
-	/**
-	 * @see RawAggregator#getGroupbyKeyValues()
-	 * @see org.apache.eagle.query.aggregate.timeseries.TimeSeriesAggregator#getGroupbyKeyValues()
-	 * 
-	 * @return
-	 */
-	public List<GroupbyKeyValue> getGroupbyKeyValues();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyComparator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyComparator.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyComparator.java
deleted file mode 100755
index f976c8c..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyComparator.java
+++ /dev/null
@@ -1,43 +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.query.aggregate.raw;
-
-import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.io.BytesWritable;
-
-import java.util.Comparator;
-import java.util.List;
-import java.util.ListIterator;
-
-public class GroupbyKeyComparator implements Comparator<GroupbyKey>{
-	@Override 
-    public int compare(GroupbyKey key1, GroupbyKey key2){
-		List<BytesWritable> list1 = key1.getValue();
-		List<BytesWritable> list2 = key2.getValue();
-		
-		if(list1 == null || list2 == null || list1.size() != list2.size())
-			throw new IllegalArgumentException("2 list of groupby fields must be non-null and have the same size");
-		ListIterator<BytesWritable> e1 = list1.listIterator();
-		ListIterator<BytesWritable> e2 = list2.listIterator();
-		while(e1.hasNext() && e2.hasNext()){
-			int r = Bytes.compareTo(e1.next().copyBytes(), e2.next().copyBytes());
-			if(r != 0)
-				return r;
-		}
-		return 0;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValue.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValue.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValue.java
deleted file mode 100755
index 2256761..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValue.java
+++ /dev/null
@@ -1,91 +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.query.aggregate.raw;
-
-import org.apache.hadoop.io.Writable;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
- * <h3>Groupby KeyValue Structure</h3>
- * <pre>
- * {
- *  key: GroupbyKey
- *  value: GroupbyValue
- * }
- * </pre>
- * @see GroupbyKey
- * @see GroupbyValue
- *
- * @since : 11/4/14,2014
- */
-public class GroupbyKeyValue implements Writable {
-	private GroupbyKey key;
-	private GroupbyValue value;
-	public GroupbyKeyValue(){
-		this.key = new GroupbyKey();
-		this.value = new GroupbyValue();
-	}
-	public GroupbyKeyValue(GroupbyKey key,GroupbyValue value){
-		this.key = key;
-		this.value = value;
-	}
-	public GroupbyKey getKey() {
-		return key;
-	}
-
-	public void setKey(GroupbyKey key) {
-		this.key = key;
-	}
-
-	public GroupbyValue getValue() {
-		return value;
-	}
-
-	public void setValue(GroupbyValue value) {
-		this.value = value;
-	}
-
-	/**
-	 * Serialize the fields of this object to <code>out</code>.
-	 *
-	 * @param out <code>DataOuput</code> to serialize this object into.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void write(DataOutput out) throws IOException {
-		this.key.write(out);
-		this.value.write(out);
-	}
-
-	/**
-	 * Deserialize the fields of this object from <code>in</code>.
-	 * <p/>
-	 * <p>For efficiency, implementations should attempt to re-use storage in the
-	 * existing object where possible.</p>
-	 *
-	 * @param in <code>DataInput</code> to deseriablize this object from.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void readFields(DataInput in) throws IOException {
-		this.key.readFields(in);
-		this.value.readFields(in);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValueCreationListener.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValueCreationListener.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValueCreationListener.java
deleted file mode 100755
index 6ca4bec..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyKeyValueCreationListener.java
+++ /dev/null
@@ -1,24 +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.query.aggregate.raw;
-
-/**
- * @since : 11/11/14,2014
- */
-public interface GroupbyKeyValueCreationListener {
-	void keyValueCreated(GroupbyKeyValue kv);
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyValue.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyValue.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyValue.java
deleted file mode 100755
index b7f2c43..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/GroupbyValue.java
+++ /dev/null
@@ -1,139 +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.query.aggregate.raw;
-
-import org.apache.eagle.common.ByteUtil;
-import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.Writable;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
- * <h3>Strucutre</h3>
- * <pre>
- * {
- *   value: List[byte[],...],
- *   meta : List[byte[],...] // byte[] may be serialized value
- *                           // of any type of value like:
- *                           // Integer,Double or Object
- *                           // and so on
- * }
- * </pre>
- *
- * TODO: Add self-described serializer or deserializer for meta bytes array, so that any side of the RPC will know how to read/write meta information
- *
- * @since : 11/4/14,2014
- */
-public class GroupbyValue implements Writable{
-	private final WritableList<DoubleWritable> value;
-	private WritableList<BytesWritable> meta;
-	private int initialCapacity=1;
-	public GroupbyValue(){
-		this(1);
-	}
-	/**
-	 * Constructs an empty list with the specified initial capacity.
-	 *
-	 * @param   initialCapacity   the initial capacity of the list
-	 * @exception IllegalArgumentException if the specified initial capacity
-	 *            is negative
-	 */
-	public GroupbyValue(int initialCapacity ){
-		this.initialCapacity = initialCapacity;
-		this.value = new WritableList<DoubleWritable>(DoubleWritable.class,this.initialCapacity);
-		this.meta = new WritableList<BytesWritable>(BytesWritable.class,this.initialCapacity);
-	}
-
-	public WritableList<DoubleWritable> getValue(){
-		return this.value;
-	}
-
-	public WritableList<BytesWritable> getMeta(){
-		return this.meta;
-	}
-
-	public DoubleWritable get(int index){
-		return this.value.get(index);
-	}
-
-	public BytesWritable getMeta(int index){
-		if(this.meta==null) return null;
-		return this.meta.get(index);
-	}
-
-	// Values
-	public void add(DoubleWritable value){
-		this.value.add(value);
-	}
-	public void add(Double value){
-		this.value.add(new DoubleWritable(value));
-	}
-
-	public void set(int index,DoubleWritable value){
-		this.value.set(index, value);
-	}
-
-	//////////////
-	// Meta
-	/////////////
-	public void addMeta(BytesWritable meta){
-		this.meta.add(meta);
-	}
-
-	public void addMeta(int meta){
-		this.meta.add(new BytesWritable(ByteUtil.intToBytes(meta)));
-	}
-
-	public void setMeta(int index,BytesWritable meta){
-		this.meta.set(index,meta);
-	}
-	public void setMeta(int index,int meta){
-		this.meta.set(index, new BytesWritable(ByteUtil.intToBytes(meta)));
-	}
-
-	/**
-	 * Serialize the fields of this object to <code>out</code>.
-	 *
-	 * @param out <code>DataOuput</code> to serialize this object into.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void write(DataOutput out) throws IOException {
-		out.writeInt(this.initialCapacity);
-		this.value.write(out);
-		this.meta.write(out);
-	}
-
-	/**
-	 * Deserialize the fields of this object from <code>in</code>.
-	 * <p/>
-	 * <p>For efficiency, implementations should attempt to re-use storage in the
-	 * existing object where possible.</p>
-	 *
-	 * @param in <code>DataInput</code> to deseriablize this object from.
-	 * @throws java.io.IOException
-	 */
-	@Override
-	public void readFields(DataInput in) throws IOException {
-		this.initialCapacity = in.readInt();
-		this.value.readFields(in);
-		this.meta.readFields(in);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawAggregator.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawAggregator.java
deleted file mode 100755
index 0468074..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawAggregator.java
+++ /dev/null
@@ -1,71 +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.query.aggregate.raw;
-
-import org.apache.eagle.log.entity.QualifierCreationListener;
-import org.apache.eagle.log.entity.meta.EntityDefinition;
-import org.apache.eagle.query.aggregate.AggregateFunctionType;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-public class RawAggregator implements QualifierCreationListener,GroupbyKeyAggregatable {
-	private List<String> groupbyFields;
-	private GroupbyKey key;
-	private static final byte[] UNASSIGNED = "unassigned".getBytes();
-	private RawGroupbyBucket bucket;
-
-	public RawAggregator(List<String> groupbyFields, List<AggregateFunctionType> aggregateFunctionTypes, List<String> aggregatedFields, EntityDefinition ed){
-		this.groupbyFields = groupbyFields;
-		key = new GroupbyKey();
-		bucket = new RawGroupbyBucket(aggregateFunctionTypes, aggregatedFields, ed);
-	}
-
-	@Override
-	public void qualifierCreated(Map<String, byte[]> qualifiers){
-		key.clear();
-		ListIterator<String> it = groupbyFields.listIterator();
-		while(it.hasNext()){
-			byte[] groupbyFieldValue = qualifiers.get(it.next());
-			if(groupbyFieldValue == null){
-				key.addValue(UNASSIGNED);
-			}else{
-				key.addValue(groupbyFieldValue);
-			}
-		}
-		GroupbyKey newKey = null;
-		if(bucket.exists(key)){
-			newKey = key;
-		}else{
-			newKey = new GroupbyKey(key);
-		}
-		
-		bucket.addDatapoint(newKey, qualifiers);
-	}
-
-	/**
-	 * @return
-	 */
-	public Map<List<String>, List<Double>> result(){
-		return bucket.result();
-	}
-
-	public List<GroupbyKeyValue> getGroupbyKeyValues(){
-		return bucket.groupbyKeyValues();
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawGroupbyBucket.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawGroupbyBucket.java b/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawGroupbyBucket.java
deleted file mode 100755
index 47b84a0..0000000
--- a/eagle-core/eagle-query/eagle-query-base/src/main/java/org/apache/eagle/query/aggregate/raw/RawGroupbyBucket.java
+++ /dev/null
@@ -1,196 +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.query.aggregate.raw;
-
-import org.apache.eagle.log.entity.EntityQualifierUtils;
-import org.apache.eagle.log.entity.GenericMetricEntity;
-import org.apache.eagle.log.entity.meta.*;
-import org.apache.eagle.log.expression.ExpressionParser;
-import org.apache.eagle.query.aggregate.AggregateFunctionType;
-import org.apache.eagle.query.parser.TokenConstant;
-import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.DoubleWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.*;
-
-public class RawGroupbyBucket {
-	private final static Logger LOG = LoggerFactory.getLogger(RawGroupbyBucket.class);
-
-	private List<String> aggregatedFields;
-	private EntityDefinition entityDefinition;
-
-	
-	private List<AggregateFunctionType> types;
-	private SortedMap<GroupbyKey, List<Function>> group2FunctionMap =
-			new TreeMap<GroupbyKey, List<Function>>(new GroupbyKeyComparator());
-
-	public RawGroupbyBucket(List<AggregateFunctionType> types, List<String> aggregatedFields, EntityDefinition ed){
-		this.types = types;
-		this.aggregatedFields = aggregatedFields;
-		this.entityDefinition = ed;
-	}
-
-	public boolean exists(GroupbyKey key){
-		return group2FunctionMap.containsKey(key);
-	}
-
-	public void addDatapoint(GroupbyKey groupbyKey, Map<String, byte[]> values){
-		// locate groupby bucket
-		List<Function> functions = group2FunctionMap.get(groupbyKey);
-		if(functions == null){
-			functions = new ArrayList<Function>();
-			for(AggregateFunctionType type : types){
-				FunctionFactory ff = FunctionFactory.locateFunctionFactory(type);
-				if(ff == null){
-					LOG.error("FunctionFactory of AggregationFunctionType:"+type+" is null");
-				}else{
-					functions.add(ff.createFunction());
-				}
-			}
-			group2FunctionMap.put(groupbyKey, functions);
-		}
-		ListIterator<Function> e1 = functions.listIterator();
-		ListIterator<String> e2 = aggregatedFields.listIterator();
-		while(e1.hasNext() && e2.hasNext()){
-			Function f = e1.next();
-			String aggregatedField = e2.next();
-			byte[] v = values.get(aggregatedField);
-			if(f instanceof Function.Count){ // handle count
-				if(entityDefinition.getMetricDefinition()==null) {
-					f.run(1.0);
-					continue;
-				}else if(v == null){
-					aggregatedField = GenericMetricEntity.VALUE_FIELD;
-					v = values.get(aggregatedField);
-				}
-			}
-			if(v != null){
-				Qualifier q = entityDefinition.getDisplayNameMap().get(aggregatedField);
-				EntitySerDeser<?> serDeser = q.getSerDeser();
-				// double d = 0.0;
-				if(serDeser instanceof IntSerDeser){
-					double d= (Integer)serDeser.deserialize(v);
-					f.run(d);
-				}else if(serDeser instanceof LongSerDeser){
-					double d = (Long)serDeser.deserialize(v);
-					f.run(d);
-				}else if(serDeser instanceof DoubleSerDeser){
-					double d = (Double)serDeser.deserialize(v);
-					f.run(d);
-				// TODO: support numeric array type that is not metric
-				}else if(serDeser instanceof DoubleArraySerDeser){
-					double[] d = ((DoubleArraySerDeser) serDeser).deserialize(v);
-					if(f instanceof Function.Count){
-						f.run(d.length);
-					} else {
-						for(double i:d) f.run(i);
-					}
-				}else if(serDeser instanceof IntArraySerDeser){
-					int[] d = ((IntArraySerDeser) serDeser).deserialize(v);
-					if(f instanceof Function.Count){
-						f.run(d.length);
-					}else{
-						for(int i:d) f.run(i);
-					}
-				}else{
-					if(LOG.isDebugEnabled()) LOG.debug("EntitySerDeser of field "+aggregatedField+" is not IntSerDeser or LongSerDeser or DoubleSerDeser or IntArraySerDeser or DoubleArraySerDeser, default as 0.0");
-				}
-			}else if(TokenConstant.isExpression(aggregatedField)){
-				String expression = TokenConstant.parseExpressionContent(aggregatedField);
-				try {
-					Map<String,Double> doubleMap = EntityQualifierUtils.bytesMapToDoubleMap(values, entityDefinition);
-					if(entityDefinition.getMetricDefinition() == null) {
-						double value = ExpressionParser.eval(expression,doubleMap);
-						// LOG.info("DEBUG: Eval "+expression +" = "+value);
-						f.run(value);
-					}else{
-						Qualifier qualifier = entityDefinition.getDisplayNameMap().get(GenericMetricEntity.VALUE_FIELD);
-						EntitySerDeser _serDeser = qualifier.getSerDeser();
-						byte[] valueBytes = values.get(GenericMetricEntity.VALUE_FIELD);
-						if( _serDeser instanceof DoubleArraySerDeser){
-							double[] d = (double[]) _serDeser.deserialize(valueBytes);
-							if(f instanceof Function.Count) {
-								f.run(d.length);
-							}else{
-								for(double i:d){
-									doubleMap.put(GenericMetricEntity.VALUE_FIELD,i);
-									f.run(ExpressionParser.eval(expression, doubleMap));
-								}
-							}
-						}else if(_serDeser instanceof IntArraySerDeser){
-							int[] d = (int[]) _serDeser.deserialize(valueBytes);
-							if(f instanceof Function.Count) {
-								f.run(d.length);
-							}else {
-								for (double i : d) {
-									doubleMap.put(GenericMetricEntity.VALUE_FIELD, i);
-									f.run(ExpressionParser.eval(expression, doubleMap));
-								}
-							}
-						}else{
-							double value = ExpressionParser.eval(expression,doubleMap);
-							f.run(value);
-						}
-					}
-				} catch (Exception e) {
-					LOG.error("Got exception to evaluate expression: "+expression+", exception: "+e.getMessage(),e);
-				}
-			}
-		}
-	}
-
-	/**
-	 * expensive operation - create objects and format the result
-	 * @return
-	 */
-	public List<GroupbyKeyValue> groupbyKeyValues(){
-		List<GroupbyKeyValue> results = new ArrayList<GroupbyKeyValue>();
-		for(Map.Entry<GroupbyKey, List<Function>> entry : this.group2FunctionMap.entrySet()){
-			GroupbyValue value = new GroupbyValue();
-			for(Function f : entry.getValue()){
-				value.add(new DoubleWritable(f.result()));
-				value.addMeta(f.count());
-			}
-			results.add(new GroupbyKeyValue(entry.getKey(),value));
-		}
-		return results;
-	}
-
-	/**
-	 * expensive operation - create objects and format the result
-	 * @return
-	 */
-	public Map<List<String>, List<Double>> result(){
-		Map<List<String>, List<Double>> result = new HashMap<List<String>, List<Double>>();
-		for(Map.Entry<GroupbyKey, List<Function>> entry : this.group2FunctionMap.entrySet()){
-			List<Double> values = new ArrayList<Double>();
-			for(Function f : entry.getValue()){
-				values.add(f.result());
-			}
-			GroupbyKey key = entry.getKey();
-			List<BytesWritable> list1 = key.getValue();
-			List<String> list2 = new ArrayList<String>();
-			for(BytesWritable e : list1){
-				list2.add(new String(e.copyBytes()));
-			}
-			result.put(list2, values);
-		}
-		return result;
-	}
-}


Mime
View raw message