[jira] [Commented] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594390#comment-14594390
 ] 

Hudson commented on PHOENIX-1920:
-

FAILURE: Integrated in Phoenix-master #791 (See 
[https://builds.apache.org/job/Phoenix-master/791/])
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads (cmarcel: rev 
7175dcbc011dff48f6d041697ec84da98f80f729)
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ScenarioResult.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WorkloadExecutor.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/DataModel.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
* .gitignore
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WriteWorkload.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataLoadTimeSummary.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/impl/ImageResultHandler.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/QueryResult.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/schema/SchemaReader.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/impl/CSVResultHandler.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/RunTime.java
* phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultHandler.java
* phoenix-pherf/src/test/resources/scenario/test_scenario.xml
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
* 
phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ConfigurationParserTest.java
* phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/Result.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataModelResult.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultValue.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataLoadThreadTime.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/Workload.java
* phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/impl/XMLResultHandler.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/file/Extension.java
* phoenix-pherf/pom.xml
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
* phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ThreadTime.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/file/Header.java
* phoenix-pherf/src/it/java/org/apache/phoenix/pherf/PherfMainIT.java
* phoenix-pherf/src/main/resources/scenario/prod_test_unsalted_scenario.xml
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
* phoenix-pherf/src/main/java/org/apache/phoenix/pherf/loaddata/DataLoader.java
* phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/QuerySetResult.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedRunner.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/XMLConfigParser.java
* 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/WriteParams.java


> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
> Fix For: 4.4.0, 4.5.0, 4.4.1
>
> Attachments: PHOENIX-1920.1.patch, PHOENIX-1920.patch
>
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594383#comment-14594383
 ] 

Hadoop QA commented on PHOENIX-1920:


{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12740735/PHOENIX-1920.1.patch
  against master branch at commit 7175dcbc011dff48f6d041697ec84da98f80f729.
  ATTACHMENT ID: 12740735

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 14 new 
or modified tests.

{color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/100//console

This message is automatically generated.

> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
> Fix For: 4.4.0, 4.5.0, 4.4.1
>
> Attachments: PHOENIX-1920.1.patch, PHOENIX-1920.patch
>
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (PHOENIX-2059) MR index build does not handle table with a schema name correctly

2015-06-19 Thread James Taylor (JIRA)
James Taylor created PHOENIX-2059:
-

 Summary: MR index build does not handle table with a schema name 
correctly
 Key: PHOENIX-2059
 URL: https://issues.apache.org/jira/browse/PHOENIX-2059
 Project: Phoenix
  Issue Type: Bug
Reporter: James Taylor
Assignee: Thomas D'Silva


The MR index build doesn't handle a table quite correctly if it has a schema 
name. [~tdsilva] knows the details and is working on a patch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2036) PhoenixConfigurationUtil should provide a pre-normalize table name to PhoenixRuntime

2015-06-19 Thread James Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594223#comment-14594223
 ] 

James Taylor commented on PHOENIX-2036:
---

LGTM, [~maghamravi]. Would you mind confirming this is what you need, 
[~siddhimehta]?

> PhoenixConfigurationUtil should provide a pre-normalize table name to 
> PhoenixRuntime
> 
>
> Key: PHOENIX-2036
> URL: https://issues.apache.org/jira/browse/PHOENIX-2036
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Siddhi Mehta
>Priority: Minor
> Attachments: PHOENIX-2036-v1.patch, PHOENIX-2036.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I was trying a basic store using PhoenixHBaseStorage and ran into some issues 
> with it complaining about TableNotFoundException.
> The table(CUSTOM_ENTITY."z02") in question exists.
> Looking at the stacktrace I think its likely related to the change in 
> PHOENIX-1682 where phoenix runtime expects a pre-normalized table name.
> We need to update 
> PhoenixConfigurationUtil.getSelectColumnMetadataList(Configuration) be pass a 
> pre-normalized table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-1993) NPE on sqlline.py start.

2015-06-19 Thread Kumar Palaniappan (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594182#comment-14594182
 ] 

Kumar Palaniappan commented on PHOENIX-1993:


Having the same issue after upgrading to 4.4

I see the tables and could do simple select, but joins are all hanging.

./sqlline.py **
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:labs-darth-datanode-lv-102 none none 
org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:labs-darth-datanode-lv-102
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
15/06/20 00:14:48 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
Connected to: Phoenix (version 4.4)
Driver: PhoenixEmbeddedDriver (version 4.4)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true 
to skip)...
1213/1213 (100%) Done
Done
java.lang.NullPointerException
at java.util.TreeMap.put(TreeMap.java:563)
at java.util.TreeSet.add(TreeSet.java:255)
at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
at java.util.TreeSet.addAll(TreeSet.java:312)
at sqlline.SqlCompleter.(SqlCompleter.java:81)
at sqlline.DatabaseConnection.setCompletions(DatabaseConnection.java:84)
at sqlline.SqlLine.setCompletions(SqlLine.java:1730)
at sqlline.Commands.connect(Commands.java:1066)
at sqlline.Commands.connect(Commands.java:996)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at 
sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
at sqlline.SqlLine.dispatch(SqlLine.java:804)
at sqlline.SqlLine.initArgs(SqlLine.java:588)
at sqlline.SqlLine.begin(SqlLine.java:656)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)
sqlline version 1.1.8


> NPE on sqlline.py start.
> 
>
> Key: PHOENIX-1993
> URL: https://issues.apache.org/jira/browse/PHOENIX-1993
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
>Reporter: Serhiy Bilousov
>Priority: Minor
>
> After updating to 4.4  sqlline throw exception on the start. It does not look 
> like it affects use afterwards thou. 
> {noformat}
> ./sqlline.py *:2181:/hbase
> Setting property: [isolation, TRANSACTION_READ_COMMITTED]
> issuing: !connect jdbc:phoenix:***:2181:/hbase none none 
> org.apache.phoenix.jdbc.PhoenixDriver
> Connecting to jdbc:phoenix:**:2181:/hbase
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
> details.
> 15/05/19 13:41:46 WARN util.NativeCodeLoader: Unable to load native-hadoop 
> library for your platform... using builtin-java classes where applicable
> Connected to: Phoenix (version 4.4)
> Driver: PhoenixEmbeddedDriver (version 4.4)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to 
> true to skip)...
> 346/346 (100%) Done
> Done
> java.lang.NullPointerException
> at java.util.TreeMap.put(TreeMap.java:563)
> at java.util.TreeSet.add(TreeSet.java:255)
> at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
> at java.util.TreeSet.addAll(TreeSet.java:312)
> at sqlline.SqlCompleter.(SqlCompleter.java:81)
> at 
> sqlline.DatabaseConnection.setCompletions(DatabaseConnection.java:84)
> at sqlline.SqlLine.setCompletions(SqlLine.java:1730)
> at sqlline.Commands.connect(Commands.java:1066)
> at sqlline.Commands.connect(Commands.java:996)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at 
> sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
> at sqlline.SqlLine.dispatch(SqlLine.java:804)
> at

[jira] [Commented] (PHOENIX-2057) Acquire lock in MetaDataEndPointImpl.addRowsToChildViews() before calling doGetTable()

2015-06-19 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594134#comment-14594134
 ] 

Hudson commented on PHOENIX-2057:
-

SUCCESS: Integrated in Phoenix-master #790 (See 
[https://builds.apache.org/job/Phoenix-master/790/])
PHOENIX-2057 Acquire lock in MetaDataEndPointImpl.addRowsToChildViews() before 
calling doGetTable() (samarth.jain: rev 
466eeb35f904c1c768dd3da7b396001826a1b40c)
* 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java


> Acquire lock in MetaDataEndPointImpl.addRowsToChildViews() before calling 
> doGetTable()
> --
>
> Key: PHOENIX-2057
> URL: https://issues.apache.org/jira/browse/PHOENIX-2057
> Project: Phoenix
>  Issue Type: Bug
>Reporter: James Taylor
>Assignee: Samarth Jain
> Fix For: 5.0.0, 4.5.0
>
> Attachments: PHOENIX-2057.patch
>
>
> Rather than acquiring the row lock in doGetTable and then letting the lock be 
> released and then getting it again right afterwards, it'd be better to 
> acquire the lock upfront and pass it into doGetTable, like this:
> {code}
> private void addRowsToChildViews(List tableMetadata, 
> List mutationsForAddingColumnsToViews, byte[] schemaName, byte[] 
> tableName,
> List invalidateList, long clientTimeStamp, 
> TableViewFinderResult childViewsResult,
> Region region, List locks) throws IOException, 
> SQLException {
> for (Result viewResult : childViewsResult.getResults()) {
> byte[][] rowViewKeyMetaData = new byte[3][];
> getVarChars(viewResult.getRow(), 3, rowViewKeyMetaData);
> byte[] viewTenantId = 
> rowViewKeyMetaData[PhoenixDatabaseMetaData.TENANT_ID_INDEX];
> byte[] viewSchemaName = 
> rowViewKeyMetaData[PhoenixDatabaseMetaData.SCHEMA_NAME_INDEX];
> byte[] viewName = 
> rowViewKeyMetaData[PhoenixDatabaseMetaData.TABLE_NAME_INDEX];
> // lock the rows corresponding to views so that no other thread 
> can modify the view meta-data
> // TODO: modify acquireLock to return the RowLock
> RowLock rowLock = acquireLock(region, viewKey, locks);
> byte[] viewKey = SchemaUtil.getTableKey(viewTenantId, 
> viewSchemaName, viewName);
> PTable view = doGetTable(viewKey, clientTimeStamp, rowLock);
> if (view.getBaseColumnCount() == 
> QueryConstants.DIVORCED_VIEW_BASE_COLUMN_COUNT) {
> // if a view has divorced itself from the base table, we 
> don't allow schema changes
> // to be propagated to it.
> return;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-1504) Support adding column to a table that has views

2015-06-19 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594135#comment-14594135
 ] 

Hudson commented on PHOENIX-1504:
-

SUCCESS: Integrated in Phoenix-master #790 (See 
[https://builds.apache.org/job/Phoenix-master/790/])
PHOENIX-1504 Support adding column to a table that has views (Samarth Jain/Dave 
Hacker) (samarth.jain: rev e78eb6faceec40d8b09fbc7dde778b87fe54feef)
* 
phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java
* phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/DelegateTable.java
* phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
* 
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
* 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
* 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
* phoenix-core/src/main/java/org/apache/phoenix/util/ByteUtil.java
* 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
* 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PTableProtos.java


> Support adding column to a table that has views
> ---
>
> Key: PHOENIX-1504
> URL: https://issues.apache.org/jira/browse/PHOENIX-1504
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Samarth Jain
> Fix For: 5.0.0, 4.5.0
>
> Attachments: PHOENIX-1504-4.x-1.0.patch, PHOENIX-1504-wip.patch, 
> PHOENIX-1504.patch, PHOENIX-1504_master.patch, PHOENIX-1504_v2.patch, 
> PHOENIX-1504_v3.patch
>
>
> We currently disallow any schema modifications to a table that has views. We 
> should relax that constraint and push the schema change as necessary out to 
> all views.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2021) Implement ARRAY_CAT built in function

2015-06-19 Thread James Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594091#comment-14594091
 ] 

James Taylor commented on PHOENIX-2021:
---

LGTM. Thanks for all the excellent work on this, [~Dumindux] and [~ram_krish].

> Implement ARRAY_CAT built in function
> -
>
> Key: PHOENIX-2021
> URL: https://issues.apache.org/jira/browse/PHOENIX-2021
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Dumindu Buddhika
>Assignee: Dumindu Buddhika
> Attachments: PHOENIX-2021-v3.patch, PHOENIX-2021-v4.patch, 
> PHOENIX-2021-v5.patch, PHOENIX-2021.patch
>
>
> Ex:
> ARRAY_CAT(ARRAY[2, 3, 4], ARRAY[4, 5, 6]) = ARRAY[2,3,4,4,5,6]
> ARRAY_CAT(ARRAY["a", "b"], ARRAY["c", "d"]) = ARRAY["a", "b", "c", "d"]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Cody Marcel (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cody Marcel updated PHOENIX-1920:
-
Attachment: PHOENIX-1920.1.patch

Unit tests were failing on previous patch due to a setter being removed. I have 
added the setter back in this patch. All unit and pherf IT tests pass. 

"mvn clean verify" hangs fro and and can't get it to complete.

> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
> Fix For: 4.4.0, 4.5.0, 4.4.1
>
> Attachments: PHOENIX-1920.1.patch, PHOENIX-1920.patch
>
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Cody Marcel (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cody Marcel updated PHOENIX-1920:
-
Attachment: PHOENIX-1920.patch

> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
> Fix For: 4.4.0, 4.5.0, 4.4.1
>
> Attachments: PHOENIX-1920.patch
>
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Updated] (PHOENIX-1118) Provide a tool for visualizing Phoenix tracing information

2015-06-19 Thread Ayola Jayamaha
Hi All,

Milestone-1 can be found in my git repo[1].
Features :

   - Adding tracing to a timeline using sample json
   - Comparing two or more traces on the timeline
   - Visualizing the trace distribution across the time axis
   - Removing a trace from the list of traces represented on the chart
   - Listing the tracing information on a table

Any feedback will be appreciated.
Thanks.

 [1] https://github.com/AyolaJayamaha/TracingWebApp/tree/milestone-1

On Wed, Jun 17, 2015 at 11:35 PM, Ayola Jayamaha 
wrote:

>
> Hi All,
>
> You can find milestone-1 in my git repo. This is the working branch[1]. It
> has not been binded to backend yet. But the visualization of traces can be
> seen from the code.
> Traces can be selected from table/time period and shown on the timeline as
> [2]. The parameters could be entered as TableName, StartTime, EndTime and
> the traces would be listed down. The user can select the traces as his
> preference and view their timelines. Is the procedure ok?
> The start time of different traces could be visualized by bringing them up
> to a same time reference for comparison.
>
>
> [1] https://github.com/AyolaJayamaha/TracingWebApp/tree/milestone-1
> [2] https://issues.apache.org/jira/secure/attachment/12740161/timeline.png
>
>
> On Tue, Jun 16, 2015 at 11:10 AM, Ayola Jayamaha 
> wrote:
>
>> Hi All,
>>
>> Attached here are the table schema and data for the join query I
>> executed.
>>
>> ./psql.py localhost:2181/hbase ../examples/school/school.sql
>> ../examples/school/STUDENTS.csv ../examples/school/SUBJECTS.csv
>> ../examples/school/MARKS.csv ../examples/school/school_queries.sql
>>
>> Above is the command I executed. But the last query
>>
>> SELECT M.GRADE
>> FROM MARKS AS M
>> INNER JOIN SUBJECTS AS S
>> ON M.SUBJECT_ID = S.SUBJECT_ID;
>>
>> doesn't give any results and when I check for the traces corresponding
>> the inner join query I couldn't find them.
>>
>> What might be the issue?
>>
>> Thanks.
>>
>> ​​​
>>  school.zip
>> 
>> ​
>>
>> On Sun, Jun 14, 2015 at 9:58 PM, Ayola Jayamaha 
>> wrote:
>>
>>> Hi All,
>>>
>>> On the explain plan to show which part of the code is run where a graph
>>> is shown[1]. Default chart will be a Pie chart and I'm planing to use few
>>> more chat types so user can pick his choice. If any node responding slowly.
>>> Phoenix database administrator can exam the node and examin what are
>>> queries run on a particular time.
>>>
>>> I have run few examples on secondary indexes[4] and I got sample data
>>> and it can be used for the milestone1(end of this week). It is shown with
>>> timesliding capabilities. Trace segments are shown in a timeline.[2]
>>>
>>> Does filters mean 'where' like logic statements? The database admin can
>>> track the duration for a particular trace from timeline visualization so he
>>> can use the filters effectively (best order of the filters) in a query to
>>> get a quick respond.
>>>
>>> I tried the join query and it didn't give any results or corresponding
>>> traces. This is the reference I followed [3]. Is there any more steps to
>>> follow?
>>>
>>> To visualize the tracing details I looked through few charting libraries
>>> and I will give the comparison details over them.
>>> Please feel free to give the feedback on the mock uis.
>>>
>>> Thanks.
>>>
>>> [1]
>>> https://issues.apache.org/jira/secure/attachment/12739498/m1-mockUI-tracedistribution.png
>>> [2]
>>> https://issues.apache.org/jira/secure/attachment/12739499/m1-mockUI-tracetimeline.png
>>> [3] https://phoenix.apache.org/joins.html
>>> [4]
>>> http://ayolajayamaha.blogspot.com/2015/06/tracing-data-secondary-indixes.html
>>>
>>> On Thu, Jun 11, 2015 at 11:39 AM, Ayola Jayamaha >> > wrote:
>>>
 Yes. It  was a bit confusing :-). But it was useful to get a good idea
 on the use cases.
 Thanks.

 On Wed, Jun 10, 2015 at 11:57 PM, James Taylor 
 wrote:

> Excellent, Nishani (and you forgot to say "rambling" :-), but I'm glad
> it helped).
>
> On Wed, Jun 10, 2015 at 11:16 AM, Ayola Jayamaha <
> raphaelan...@gmail.com> wrote:
> > Hi James,
> >
> > Thanks a lot for the lengthy and descriptive reply. I am currently
> looking
> > through UI components and charting libraries that can be used for
> the UI. I
> > refered [1] with regard to your explaination and came up with some
> mock ups
> > which I will share soon.
> >
> > Thanks,
> > Nishani
> >
> > [1] https://phoenix.apache.org/language/#index_hint
> > [2]
> >
> https://phoenix.apache.org/faq.html#How_do_I_create_Secondary_Index_on_a_table
> >
> > On Tue, Jun 9, 2015 at 11:39 PM, James Taylor <
> jamestay...@apache.org>
> > wrote:
> >
> >> Hi Nishani,
> >> I'd recommend focusing on higher level use cases. From the user's
> >> point of view, they're executing a query and for some reason it's

[jira] [Updated] (PHOENIX-1118) Provide a tool for visualizing Phoenix tracing information

2015-06-19 Thread Nishani (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nishani  updated PHOENIX-1118:
--
Attachment: screenshot of tracing timeline.png

> Provide a tool for visualizing Phoenix tracing information
> --
>
> Key: PHOENIX-1118
> URL: https://issues.apache.org/jira/browse/PHOENIX-1118
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: James Taylor
>Assignee: Nishani 
>  Labels: Java, SQL, Visualization, gsoc2015, mentor
> Attachments: MockUp1-TimeSlider.png, MockUp2-AdvanceSearch.png, 
> MockUp3-PatternDetector.png, MockUp4-FlameGraph.png, Screenshot of dependency 
> tree.png, m1-mockUI-tracedistribution.png, m1-mockUI-tracetimeline.png, 
> screenshot of tracing timeline.png, screenshot of tracing web app.png, 
> timeline.png
>
>
> Currently there's no means of visualizing the trace information provided by 
> Phoenix. We should provide some simple charting over our metrics tables. Take 
> a look at the following JIRA for sample queries: 
> https://issues.apache.org/jira/browse/PHOENIX-1115?focusedCommentId=14323151&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14323151



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32850605
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WriteWorkload.java
 ---
@@ -0,0 +1,403 @@
+/*
+ * 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.phoenix.pherf.workload;
+
+import org.apache.phoenix.pherf.PherfConstants;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.WriteParams;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
+import org.apache.phoenix.pherf.exception.PherfException;
+import org.apache.phoenix.pherf.result.DataLoadThreadTime;
+import org.apache.phoenix.pherf.result.DataLoadTimeSummary;
+import org.apache.phoenix.pherf.result.ResultUtil;
+import org.apache.phoenix.pherf.rules.DataValue;
+import org.apache.phoenix.pherf.rules.RulesApplier;
+import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.util.RowCalculator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+public class WriteWorkload implements Workload {
+private static final Logger logger = 
LoggerFactory.getLogger(WriteWorkload.class);
+private final PhoenixUtil pUtil;
+private final XMLConfigParser parser;
+private final RulesApplier rulesApplier;
+private final ResultUtil resultUtil;
+private final ExecutorService pool;
+private final WriteParams writeParams;
+private final Scenario scenario;
+private final long threadSleepDuration;
+
+private final int threadPoolSize;
+private final int batchSize;
+
+public WriteWorkload(XMLConfigParser parser) throws Exception {
+this(PhoenixUtil.create(), parser);
+}
+
+public WriteWorkload(PhoenixUtil util, XMLConfigParser parser) throws 
Exception {
+this(util, parser, null);
+}
+
+public WriteWorkload(PhoenixUtil phoenixUtil, XMLConfigParser parser, 
Scenario scenario)
+throws Exception {
+this(phoenixUtil, 
PherfConstants.create().getProperties(PherfConstants.PHERF_PROPERTIES),
+parser, scenario);
+}
+
+/**
+ * Default the writers to use up all available cores for threads. If 
writeParams are used in
+ * the config files, they will override the defaults. writeParams are 
used for read/write mixed
+ * workloads.
+ * TODO extract notion of the scenario list and have 1 write workload 
per scenario
+ *
+ * @param phoenixUtil {@link 
org.apache.phoenix.pherf.util.PhoenixUtil} Query helper
+ * @param properties  {@link java.util.Properties} default properties 
to use
+ * @param parser  {@link 
org.apache.phoenix.pherf.configuration.XMLConfigParser}
+ * @param scenario{@link 
org.apache.phoenix.pherf.configuration.Scenario} If null is passed
+ *it will run against all scenarios in the parsers 
list.
+ * @throws Exception
+ */
+public WriteWorkload(PhoenixUtil phoenixUtil, Properties properties, 
XMLConfigParser parser,
+Scenario scenario) throws Exception {
+this.pUtil = phoenixUtil;
+this.parser = parser;
+this.rulesApplier = new RulesApplier(parser);
+this.resultUtil = new ResultUtil();
+
+// Overwrite defaults properties with those given in the 
configuration. This indicates the
+// scenario is a R/W mi

[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32850466
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WriteWorkload.java
 ---
@@ -0,0 +1,403 @@
+/*
+ * 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.phoenix.pherf.workload;
+
+import org.apache.phoenix.pherf.PherfConstants;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.WriteParams;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
+import org.apache.phoenix.pherf.exception.PherfException;
+import org.apache.phoenix.pherf.result.DataLoadThreadTime;
+import org.apache.phoenix.pherf.result.DataLoadTimeSummary;
+import org.apache.phoenix.pherf.result.ResultUtil;
+import org.apache.phoenix.pherf.rules.DataValue;
+import org.apache.phoenix.pherf.rules.RulesApplier;
+import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.util.RowCalculator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+public class WriteWorkload implements Workload {
+private static final Logger logger = 
LoggerFactory.getLogger(WriteWorkload.class);
+private final PhoenixUtil pUtil;
+private final XMLConfigParser parser;
+private final RulesApplier rulesApplier;
+private final ResultUtil resultUtil;
+private final ExecutorService pool;
+private final WriteParams writeParams;
+private final Scenario scenario;
+private final long threadSleepDuration;
+
+private final int threadPoolSize;
+private final int batchSize;
+
+public WriteWorkload(XMLConfigParser parser) throws Exception {
+this(PhoenixUtil.create(), parser);
+}
+
+public WriteWorkload(PhoenixUtil util, XMLConfigParser parser) throws 
Exception {
+this(util, parser, null);
+}
+
+public WriteWorkload(PhoenixUtil phoenixUtil, XMLConfigParser parser, 
Scenario scenario)
+throws Exception {
+this(phoenixUtil, 
PherfConstants.create().getProperties(PherfConstants.PHERF_PROPERTIES),
+parser, scenario);
+}
+
+/**
+ * Default the writers to use up all available cores for threads. If 
writeParams are used in
+ * the config files, they will override the defaults. writeParams are 
used for read/write mixed
+ * workloads.
+ * TODO extract notion of the scenario list and have 1 write workload 
per scenario
+ *
+ * @param phoenixUtil {@link 
org.apache.phoenix.pherf.util.PhoenixUtil} Query helper
+ * @param properties  {@link java.util.Properties} default properties 
to use
+ * @param parser  {@link 
org.apache.phoenix.pherf.configuration.XMLConfigParser}
+ * @param scenario{@link 
org.apache.phoenix.pherf.configuration.Scenario} If null is passed
+ *it will run against all scenarios in the parsers 
list.
+ * @throws Exception
+ */
+public WriteWorkload(PhoenixUtil phoenixUtil, Properties properties, 
XMLConfigParser parser,
+Scenario scenario) throws Exception {
+this.pUtil = phoenixUtil;
+this.parser = parser;
+this.rulesApplier = new RulesApplier(parser);
+this.resultUtil = new ResultUtil();
+
+// Overwrite defaults properties with those given in the 
configuration. This indicates the
+// scenario is a R/W mi

[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32850256
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataModelResult.java
 ---
@@ -18,61 +18,57 @@
 
 package org.apache.phoenix.pherf.result;
 
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.phoenix.pherf.configuration.DataModel;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.DataModel;
+@XmlRootElement(namespace = "org.apache.phoenix.pherf.result") public 
class DataModelResult
+extends DataModel {
+private List scenarioResult = new 
ArrayList();
+private String zookeeper;
 
-@XmlRootElement(namespace = "org.apache.phoenix.pherf.result")
-public class DataModelResult extends DataModel {
-   private List scenarioResult = new 
ArrayList();
-   private String zookeeper;
+public List getScenarioResult() {
+return scenarioResult;
+}
 
-   public List getScenarioResult() {
-   return scenarioResult;
-   }
+@SuppressWarnings("unused") public void 
setScenarioResult(List scenarioResult) {
--- End diff --

James barked at them the last time I left it off.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32850123
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WriteWorkload.java
 ---
@@ -0,0 +1,403 @@
+/*
+ * 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.phoenix.pherf.workload;
+
+import org.apache.phoenix.pherf.PherfConstants;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.WriteParams;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
+import org.apache.phoenix.pherf.exception.PherfException;
+import org.apache.phoenix.pherf.result.DataLoadThreadTime;
+import org.apache.phoenix.pherf.result.DataLoadTimeSummary;
+import org.apache.phoenix.pherf.result.ResultUtil;
+import org.apache.phoenix.pherf.rules.DataValue;
+import org.apache.phoenix.pherf.rules.RulesApplier;
+import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.util.RowCalculator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+public class WriteWorkload implements Workload {
+private static final Logger logger = 
LoggerFactory.getLogger(WriteWorkload.class);
+private final PhoenixUtil pUtil;
+private final XMLConfigParser parser;
+private final RulesApplier rulesApplier;
+private final ResultUtil resultUtil;
+private final ExecutorService pool;
+private final WriteParams writeParams;
+private final Scenario scenario;
+private final long threadSleepDuration;
+
+private final int threadPoolSize;
+private final int batchSize;
+
+public WriteWorkload(XMLConfigParser parser) throws Exception {
+this(PhoenixUtil.create(), parser);
+}
+
+public WriteWorkload(PhoenixUtil util, XMLConfigParser parser) throws 
Exception {
+this(util, parser, null);
+}
+
+public WriteWorkload(PhoenixUtil phoenixUtil, XMLConfigParser parser, 
Scenario scenario)
+throws Exception {
+this(phoenixUtil, 
PherfConstants.create().getProperties(PherfConstants.PHERF_PROPERTIES),
+parser, scenario);
+}
+
+/**
+ * Default the writers to use up all available cores for threads. If 
writeParams are used in
+ * the config files, they will override the defaults. writeParams are 
used for read/write mixed
+ * workloads.
+ * TODO extract notion of the scenario list and have 1 write workload 
per scenario
+ *
+ * @param phoenixUtil {@link 
org.apache.phoenix.pherf.util.PhoenixUtil} Query helper
+ * @param properties  {@link java.util.Properties} default properties 
to use
+ * @param parser  {@link 
org.apache.phoenix.pherf.configuration.XMLConfigParser}
+ * @param scenario{@link 
org.apache.phoenix.pherf.configuration.Scenario} If null is passed
+ *it will run against all scenarios in the parsers 
list.
+ * @throws Exception
+ */
+public WriteWorkload(PhoenixUtil phoenixUtil, Properties properties, 
XMLConfigParser parser,
+Scenario scenario) throws Exception {
+this.pUtil = phoenixUtil;
+this.parser = parser;
+this.rulesApplier = new RulesApplier(parser);
+this.resultUtil = new ResultUtil();
+
+// Overwrite defaults properties with those given in the 
configuration. This indicates the
+// scenario is a R/W mi

[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32849281
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/RunTime.java ---
@@ -18,104 +18,91 @@
 
 package org.apache.phoenix.pherf.result;
 
+import javax.xml.bind.annotation.XmlAttribute;
 import java.util.Comparator;
 import java.util.Date;
 
-import javax.xml.bind.annotation.XmlAttribute;
-
 public class RunTime implements Comparator, Comparable {
-   private Date startTime;
-   private Integer elapsedDurationInMs;
-   private String message;
-   private Long resultRowCount;
-   private String explainPlan;
-
-@SuppressWarnings("unused")
-public RunTime() {
-}
-
-@SuppressWarnings("unused")
-public RunTime(Integer elapsedDurationInMs) {
-   this(null, elapsedDurationInMs);
-   }
-   
-   public RunTime(Long resultRowCount, Integer elapsedDurationInMs) {
-   this(null, resultRowCount, elapsedDurationInMs);
-   }
-   
-   public RunTime(Date startTime, Long resultRowCount, Integer 
elapsedDurationInMs) {
-   this(null, null, startTime, resultRowCount, 
elapsedDurationInMs);
-   }
-   
-   public RunTime(String message, Date startTime, Long resultRowCount, 
Integer elapsedDurationInMs) {
-   this(message, null, startTime, resultRowCount, 
elapsedDurationInMs);
-   }
-   
-   public RunTime(String message, String explainPlan, Date startTime, Long 
resultRowCount, Integer elapsedDurationInMs) {
-   this.elapsedDurationInMs = elapsedDurationInMs;
-   this.startTime = startTime;
-   this.resultRowCount = resultRowCount;
-   this.message = message;
-   this.explainPlan = explainPlan;
-   }
-
-   @XmlAttribute()
-   public Date getStartTime() {
-   return startTime;
-   }
-
-@SuppressWarnings("unused")
-   public void setStartTime(Date startTime) {
-   this.startTime = startTime;
-   }
-   
-   @XmlAttribute()
-   public Integer getElapsedDurationInMs() {
-   return elapsedDurationInMs;
-   }
-
-@SuppressWarnings("unused")
-public void setElapsedDurationInMs(Integer elapsedDurationInMs) {
-   this.elapsedDurationInMs = elapsedDurationInMs;
-   }
-
-   @Override
-   public int compare(RunTime r1, RunTime r2) {
-   return 
r1.getElapsedDurationInMs().compareTo(r2.getElapsedDurationInMs());
-   }
-
-   @Override
-   public int compareTo(RunTime o) {
-   return compare(this, o);
-   }
-
-   @XmlAttribute()
-   public String getMessage() {
-   return message;
-   }
-
-@SuppressWarnings("unused")
-public void setMessage(String message) {
-   this.message = message;
-   }
-   
-   @XmlAttribute()
-   public String getExplainPlan() {
-   return explainPlan;
-   }
-
-@SuppressWarnings("unused")
-public void setExplainPlan(String explainPlan) {
-   this.explainPlan = explainPlan;
-   }
-
-   @XmlAttribute()
-   public Long getResultRowCount() {
-   return resultRowCount;
-   }
-
-@SuppressWarnings("unused")
-   public void setResultRowCount(Long resultRowCount) {
-   this.resultRowCount = resultRowCount;
-   }
+private Date startTime;
--- End diff --

Unless XML bindings need them. In that case I would remove the 
suppressedwarnings annotations from the setter methods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32849038
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataModelResult.java
 ---
@@ -18,61 +18,57 @@
 
 package org.apache.phoenix.pherf.result;
 
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.phoenix.pherf.configuration.DataModel;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.DataModel;
+@XmlRootElement(namespace = "org.apache.phoenix.pherf.result") public 
class DataModelResult
+extends DataModel {
+private List scenarioResult = new 
ArrayList();
+private String zookeeper;
 
-@XmlRootElement(namespace = "org.apache.phoenix.pherf.result")
-public class DataModelResult extends DataModel {
-   private List scenarioResult = new 
ArrayList();
-   private String zookeeper;
+public List getScenarioResult() {
+return scenarioResult;
+}
 
-   public List getScenarioResult() {
-   return scenarioResult;
-   }
+@SuppressWarnings("unused") public void 
setScenarioResult(List scenarioResult) {
--- End diff --

I see. In that case maybe remove the annotation then? Because it is a 
public method, I don't think IDEs will complain either that the method is 
unused.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848856
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/QuerySetResult.java 
---
@@ -18,31 +18,30 @@
 
 package org.apache.phoenix.pherf.result;
 
+import org.apache.phoenix.pherf.configuration.QuerySet;
+
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.QuerySet;
-
 public class QuerySetResult extends QuerySet {
-   
-   private List queryResults = new ArrayList();
-
-   public QuerySetResult(QuerySet querySet) {
-   this.setConcurrency(querySet.getConcurrency());
-   this.setNumberOfExecutions(querySet.getNumberOfExecutions());
-   
this.setExecutionDurationInMs(querySet.getExecutionDurationInMs());
-   this.setExecutionType(querySet.getExecutionType());
-   }
-   
-   public QuerySetResult() {
-   }
-
-   public List getQueryResults() {
-   return queryResults;
-   }
-
-@SuppressWarnings("unused")
-public void setQueryResults(List queryResults) {
-   this.queryResults = queryResults;
-   }   
+
+private List queryResults = new ArrayList();
+
+public QuerySetResult(QuerySet querySet) {
+this.setConcurrency(querySet.getConcurrency());
+this.setNumberOfExecutions(querySet.getNumberOfExecutions());
+this.setExecutionDurationInMs(querySet.getExecutionDurationInMs());
+this.setExecutionType(querySet.getExecutionType());
+}
+
+public QuerySetResult() {
+}
+
+public List getQueryResults() {
+return queryResults;
+}
+
+@SuppressWarnings("unused") public void 
setQueryResults(List queryResults) {
--- End diff --

Good point. I think we can remove this one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848810
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ScenarioResult.java 
---
@@ -18,31 +18,31 @@
 
 package org.apache.phoenix.pherf.result;
 
+import org.apache.phoenix.pherf.configuration.Scenario;
+
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.phoenix.pherf.configuration.Scenario;
 
 public class ScenarioResult extends Scenario {
 
-   private List querySetResult = new 
ArrayList();
-   
-   public List getQuerySetResult() {
-   return querySetResult;
-   }
-
-@SuppressWarnings("unused")
-   public void setQuerySetResult(List querySetResult) {
-   this.querySetResult = querySetResult;
-   }
-   
-   public ScenarioResult() {
-   }
-   
-   public ScenarioResult(Scenario scenario) {
-   this.setDataOverride(scenario.getDataOverride());
-   this.setPhoenixProperties(scenario.getPhoenixProperties());
-   this.setRowCount(scenario.getRowCount());
-   this.setTableName(scenario.getTableName());
-   this.setName(scenario.getName());
-   }
+private List querySetResult = new 
ArrayList();
--- End diff --

Make queryResult final and remove the setter method on it since it is 
unused.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848731
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataModelResult.java
 ---
@@ -18,61 +18,57 @@
 
 package org.apache.phoenix.pherf.result;
 
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.phoenix.pherf.configuration.DataModel;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.DataModel;
+@XmlRootElement(namespace = "org.apache.phoenix.pherf.result") public 
class DataModelResult
+extends DataModel {
+private List scenarioResult = new 
ArrayList();
+private String zookeeper;
 
-@XmlRootElement(namespace = "org.apache.phoenix.pherf.result")
-public class DataModelResult extends DataModel {
-   private List scenarioResult = new 
ArrayList();
-   private String zookeeper;
+public List getScenarioResult() {
+return scenarioResult;
+}
 
-   public List getScenarioResult() {
-   return scenarioResult;
-   }
+@SuppressWarnings("unused") public void 
setScenarioResult(List scenarioResult) {
--- End diff --

All the xml data bindings require the setters


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848761
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/RunTime.java ---
@@ -18,104 +18,91 @@
 
 package org.apache.phoenix.pherf.result;
 
+import javax.xml.bind.annotation.XmlAttribute;
 import java.util.Comparator;
 import java.util.Date;
 
-import javax.xml.bind.annotation.XmlAttribute;
-
 public class RunTime implements Comparator, Comparable {
-   private Date startTime;
-   private Integer elapsedDurationInMs;
-   private String message;
-   private Long resultRowCount;
-   private String explainPlan;
-
-@SuppressWarnings("unused")
-public RunTime() {
-}
-
-@SuppressWarnings("unused")
-public RunTime(Integer elapsedDurationInMs) {
-   this(null, elapsedDurationInMs);
-   }
-   
-   public RunTime(Long resultRowCount, Integer elapsedDurationInMs) {
-   this(null, resultRowCount, elapsedDurationInMs);
-   }
-   
-   public RunTime(Date startTime, Long resultRowCount, Integer 
elapsedDurationInMs) {
-   this(null, null, startTime, resultRowCount, 
elapsedDurationInMs);
-   }
-   
-   public RunTime(String message, Date startTime, Long resultRowCount, 
Integer elapsedDurationInMs) {
-   this(message, null, startTime, resultRowCount, 
elapsedDurationInMs);
-   }
-   
-   public RunTime(String message, String explainPlan, Date startTime, Long 
resultRowCount, Integer elapsedDurationInMs) {
-   this.elapsedDurationInMs = elapsedDurationInMs;
-   this.startTime = startTime;
-   this.resultRowCount = resultRowCount;
-   this.message = message;
-   this.explainPlan = explainPlan;
-   }
-
-   @XmlAttribute()
-   public Date getStartTime() {
-   return startTime;
-   }
-
-@SuppressWarnings("unused")
-   public void setStartTime(Date startTime) {
-   this.startTime = startTime;
-   }
-   
-   @XmlAttribute()
-   public Integer getElapsedDurationInMs() {
-   return elapsedDurationInMs;
-   }
-
-@SuppressWarnings("unused")
-public void setElapsedDurationInMs(Integer elapsedDurationInMs) {
-   this.elapsedDurationInMs = elapsedDurationInMs;
-   }
-
-   @Override
-   public int compare(RunTime r1, RunTime r2) {
-   return 
r1.getElapsedDurationInMs().compareTo(r2.getElapsedDurationInMs());
-   }
-
-   @Override
-   public int compareTo(RunTime o) {
-   return compare(this, o);
-   }
-
-   @XmlAttribute()
-   public String getMessage() {
-   return message;
-   }
-
-@SuppressWarnings("unused")
-public void setMessage(String message) {
-   this.message = message;
-   }
-   
-   @XmlAttribute()
-   public String getExplainPlan() {
-   return explainPlan;
-   }
-
-@SuppressWarnings("unused")
-public void setExplainPlan(String explainPlan) {
-   this.explainPlan = explainPlan;
-   }
-
-   @XmlAttribute()
-   public Long getResultRowCount() {
-   return resultRowCount;
-   }
-
-@SuppressWarnings("unused")
-   public void setResultRowCount(Long resultRowCount) {
-   this.resultRowCount = resultRowCount;
-   }
+private Date startTime;
--- End diff --

I would make all these member variables final and remove the corresponding 
setters.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848394
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/QuerySetResult.java 
---
@@ -18,31 +18,30 @@
 
 package org.apache.phoenix.pherf.result;
 
+import org.apache.phoenix.pherf.configuration.QuerySet;
+
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.QuerySet;
-
 public class QuerySetResult extends QuerySet {
-   
-   private List queryResults = new ArrayList();
-
-   public QuerySetResult(QuerySet querySet) {
-   this.setConcurrency(querySet.getConcurrency());
-   this.setNumberOfExecutions(querySet.getNumberOfExecutions());
-   
this.setExecutionDurationInMs(querySet.getExecutionDurationInMs());
-   this.setExecutionType(querySet.getExecutionType());
-   }
-   
-   public QuerySetResult() {
-   }
-
-   public List getQueryResults() {
-   return queryResults;
-   }
-
-@SuppressWarnings("unused")
-public void setQueryResults(List queryResults) {
-   this.queryResults = queryResults;
-   }   
+
+private List queryResults = new ArrayList();
+
+public QuerySetResult(QuerySet querySet) {
+this.setConcurrency(querySet.getConcurrency());
+this.setNumberOfExecutions(querySet.getNumberOfExecutions());
+this.setExecutionDurationInMs(querySet.getExecutionDurationInMs());
+this.setExecutionType(querySet.getExecutionType());
+}
+
+public QuerySetResult() {
+}
+
+public List getQueryResults() {
+return queryResults;
+}
+
+@SuppressWarnings("unused") public void 
setQueryResults(List queryResults) {
--- End diff --

I would make queryResults final and remove the method. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848277
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java ---
@@ -51,13 +58,11 @@
 private volatile boolean shouldStop = false;
--- End diff --

Atomic is better. I will change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848343
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/DataModelResult.java
 ---
@@ -18,61 +18,57 @@
 
 package org.apache.phoenix.pherf.result;
 
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.phoenix.pherf.configuration.DataModel;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
-import org.apache.phoenix.pherf.configuration.DataModel;
+@XmlRootElement(namespace = "org.apache.phoenix.pherf.result") public 
class DataModelResult
+extends DataModel {
+private List scenarioResult = new 
ArrayList();
+private String zookeeper;
 
-@XmlRootElement(namespace = "org.apache.phoenix.pherf.result")
-public class DataModelResult extends DataModel {
-   private List scenarioResult = new 
ArrayList();
-   private String zookeeper;
+public List getScenarioResult() {
+return scenarioResult;
+}
 
-   public List getScenarioResult() {
-   return scenarioResult;
-   }
+@SuppressWarnings("unused") public void 
setScenarioResult(List scenarioResult) {
--- End diff --

Same comment about using SuppressWarnings("unused") here. I would remove 
the method and make scenarioResult final.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848223
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/WriteParams.java
 ---
@@ -0,0 +1,72 @@
+/*
+ * 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.phoenix.pherf.configuration;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+public class WriteParams {
+private int writerThreadCount;
+private long threadSleepDuration;
+private long batchSize;
+private long executionDurationInMs;
+
+public WriteParams() {
+this.batchSize = Long.MIN_VALUE;
+this.writerThreadCount = Integer.MIN_VALUE;
+this.threadSleepDuration = Long.MIN_VALUE;
+this.executionDurationInMs = Long.MAX_VALUE;
+}
+
+public long getThreadSleepDuration() {
+return threadSleepDuration;
+}
+
+@SuppressWarnings("unused")
--- End diff --

No choice here. The setters are being called by the xml bindings. You just 
don't see the references to them because they are called dynamically. They are 
being called though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848091
  
--- Diff: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java 
---
@@ -146,49 +173,77 @@ public void run() throws Exception {
 }
 return;
 }
-workloadExec = (scenarioFile == null)
-? new WorkloadExecutor(properties,
-new 
XMLConfigParser(PherfConstants.DEFAULT_FILE_PATTERN),
-monitor)
-: new WorkloadExecutor(properties,
-new XMLConfigParser(scenarioFile),
-monitor);
+XMLConfigParser parser = new XMLConfigParser(scenarioFile);
 
 // Drop tables with PHERF schema and regex comparison
 if (null != dropPherfTablesRegEx) {
-logger.info("\nDropping existing table with PHERF namename 
and "
-+ dropPherfTablesRegEx + " regex expression.");
-new PhoenixUtil().deleteTables(dropPherfTablesRegEx);
+logger.info(
+"\nDropping existing table with PHERF namename and 
" + dropPherfTablesRegEx
++ " regex expression.");
+phoenixUtil.deleteTables(dropPherfTablesRegEx);
 }
 
-// Schema and Data Load
-if (loadData) {
+if (monitor) {
+MonitorManager
+monitorManager =
+new MonitorManager(Integer.parseInt(
+
properties.getProperty("pherf.default.monitorFrequency")));
+workloadExecutor.add(monitorManager);
--- End diff --

We want the monitor to run through the duration of the workloads. If we 
call get here, it would block on the monitor until it completed then exit 
before the other workloads finish. 

I am glad you commented on this though. I just realized I am not calling 
complete() on the monitor at the end. So it can block indefinitely right now or 
leave the monitor dangling. I'll make that change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32848076
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java ---
@@ -135,10 +155,8 @@ public synchronized boolean shouldStop() {
 return shouldStop;
 }
 
-public synchronized void stop() {
-this.shouldStop = true;
-}
-
+// Convenience method for testing.
+@SuppressWarnings("unused")
 public synchronized long getRowCount() {
--- End diff --

No extra synchronization needed here because rowCount is already 
AtomicLong. Unless the intent is to not let shouldStop, rowCount, isRunning get 
modified concurrently since you are guarding accesses to them by doing 
synchronizing on "this" . 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32847785
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java ---
@@ -51,13 +58,11 @@
 private volatile boolean shouldStop = false;
--- End diff --

shouldStop doesn't need to be volatile. You are already synchronizing 
accesses to it. Better would be to make shouldStop final and an AtomicBoolean. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32847303
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/WriteParams.java
 ---
@@ -0,0 +1,72 @@
+/*
+ * 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.phoenix.pherf.configuration;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+public class WriteParams {
+private int writerThreadCount;
+private long threadSleepDuration;
+private long batchSize;
+private long executionDurationInMs;
+
+public WriteParams() {
+this.batchSize = Long.MIN_VALUE;
+this.writerThreadCount = Integer.MIN_VALUE;
+this.threadSleepDuration = Long.MIN_VALUE;
+this.executionDurationInMs = Long.MAX_VALUE;
+}
+
+public long getThreadSleepDuration() {
+return threadSleepDuration;
+}
+
+@SuppressWarnings("unused")
--- End diff --

Same comment for setBatchSize(), setWriterThreadCount(), 
setExecutionDurationInMs()


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32847228
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/WriteParams.java
 ---
@@ -0,0 +1,72 @@
+/*
+ * 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.phoenix.pherf.configuration;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+public class WriteParams {
+private int writerThreadCount;
+private long threadSleepDuration;
+private long batchSize;
+private long executionDurationInMs;
+
+public WriteParams() {
+this.batchSize = Long.MIN_VALUE;
+this.writerThreadCount = Integer.MIN_VALUE;
+this.threadSleepDuration = Long.MIN_VALUE;
+this.executionDurationInMs = Long.MAX_VALUE;
+}
+
+public long getThreadSleepDuration() {
+return threadSleepDuration;
+}
+
+@SuppressWarnings("unused")
--- End diff --

Not sure if I am a fan of @SuppressWarnings("unused") especially for 
setters. I would strive to make all member state final and get rid of the 
unused setter methods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread codymarcel
Github user codymarcel commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32847155
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WorkloadExecutor.java
 ---
@@ -19,95 +19,92 @@
 package org.apache.phoenix.pherf.workload;
 
 import org.apache.phoenix.pherf.PherfConstants;
-import org.apache.phoenix.pherf.PherfConstants.RunMode;
-import org.apache.phoenix.pherf.configuration.XMLConfigParser;
-import org.apache.phoenix.pherf.jmx.MonitorManager;
-import org.apache.phoenix.pherf.loaddata.DataLoader;
-
-import org.apache.phoenix.pherf.util.ResourceList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Properties;
+import java.util.*;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
 
 public class WorkloadExecutor {
 private static final Logger logger = 
LoggerFactory.getLogger(WorkloadExecutor.class);
-private final XMLConfigParser parser;
-private MonitorManager monitor;
-private Future monitorThread;
 private final int poolSize;
+private final Map jobs = new HashMap<>();
 
 private final ExecutorService pool;
 
-
 public WorkloadExecutor() throws Exception {
 
this(PherfConstants.create().getProperties(PherfConstants.PHERF_PROPERTIES));
 }
 
-public WorkloadExecutor(Properties properties) throws Exception{
-this(properties,PherfConstants.DEFAULT_FILE_PATTERN);
+public WorkloadExecutor(Properties properties) throws Exception {
+this(properties, new ArrayList());
 }
 
-public WorkloadExecutor(Properties properties, String filePattern) 
throws Exception {
-this(properties,
-new XMLConfigParser(filePattern),
-true);
+public WorkloadExecutor(Properties properties, List 
workloads) throws Exception {
+this.poolSize =
+(properties.getProperty("pherf.default.threadpool") == 
null) ?
+PherfConstants.DEFAULT_THREAD_POOL_SIZE :
+
Integer.parseInt(properties.getProperty("pherf.default.threadpool"));
+
+this.pool = Executors.newFixedThreadPool(this.poolSize);
+init(workloads);
 }
 
-public WorkloadExecutor(Properties properties, XMLConfigParser parser, 
boolean monitor) throws Exception {
-this.parser = parser;
-this.poolSize = 
(properties.getProperty("pherf.default.threadpool") == null)
-? PherfConstants.DEFAULT_THREAD_POOL_SIZE
-: 
Integer.parseInt(properties.getProperty("pherf.default.threadpool"));
+public void add(Workload workload) throws Exception {
+this.jobs.put(workload, pool.submit(workload.execute()));
+}
 
-this.pool = Executors.newFixedThreadPool(this.poolSize);
-if (monitor) {
-
initMonitor(Integer.parseInt(properties.getProperty("pherf.default.monitorFrequency")));
+/**
+ * Blocks on waiting for all workloads to finish. If a
+ * {@link org.apache.phoenix.pherf.workload.Workload} Requires 
complete() to be called, it must
+ * be called prior to using this method. Otherwise it will block 
infinitely.
+ */
+public synchronized void get() {
--- End diff --

Yep, I can remove synchronized.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r32847079
  
--- Diff: phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java 
---
@@ -146,49 +173,77 @@ public void run() throws Exception {
 }
 return;
 }
-workloadExec = (scenarioFile == null)
-? new WorkloadExecutor(properties,
-new 
XMLConfigParser(PherfConstants.DEFAULT_FILE_PATTERN),
-monitor)
-: new WorkloadExecutor(properties,
-new XMLConfigParser(scenarioFile),
-monitor);
+XMLConfigParser parser = new XMLConfigParser(scenarioFile);
 
 // Drop tables with PHERF schema and regex comparison
 if (null != dropPherfTablesRegEx) {
-logger.info("\nDropping existing table with PHERF namename 
and "
-+ dropPherfTablesRegEx + " regex expression.");
-new PhoenixUtil().deleteTables(dropPherfTablesRegEx);
+logger.info(
+"\nDropping existing table with PHERF namename and 
" + dropPherfTablesRegEx
++ " regex expression.");
+phoenixUtil.deleteTables(dropPherfTablesRegEx);
 }
 
-// Schema and Data Load
-if (loadData) {
+if (monitor) {
+MonitorManager
+monitorManager =
+new MonitorManager(Integer.parseInt(
+
properties.getProperty("pherf.default.monitorFrequency")));
+workloadExecutor.add(monitorManager);
--- End diff --

Should we wait for monitor job to be executed or kicked off by doing a 
workloadExecutor.get() or workloadExecutor.get(monitorManager)? Or is the 
intent to rely on subsequent workloadExecutor.get() calls to have them wait on 
MonitorManager.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] phoenix pull request: Mixed R/W workload support

2015-06-19 Thread samarthjain
Github user samarthjain commented on a diff in the pull request:

https://github.com/apache/phoenix/pull/89#discussion_r3284
  
--- Diff: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/WorkloadExecutor.java
 ---
@@ -19,95 +19,92 @@
 package org.apache.phoenix.pherf.workload;
 
 import org.apache.phoenix.pherf.PherfConstants;
-import org.apache.phoenix.pherf.PherfConstants.RunMode;
-import org.apache.phoenix.pherf.configuration.XMLConfigParser;
-import org.apache.phoenix.pherf.jmx.MonitorManager;
-import org.apache.phoenix.pherf.loaddata.DataLoader;
-
-import org.apache.phoenix.pherf.util.ResourceList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Properties;
+import java.util.*;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
 
 public class WorkloadExecutor {
 private static final Logger logger = 
LoggerFactory.getLogger(WorkloadExecutor.class);
-private final XMLConfigParser parser;
-private MonitorManager monitor;
-private Future monitorThread;
 private final int poolSize;
+private final Map jobs = new HashMap<>();
 
 private final ExecutorService pool;
 
-
 public WorkloadExecutor() throws Exception {
 
this(PherfConstants.create().getProperties(PherfConstants.PHERF_PROPERTIES));
 }
 
-public WorkloadExecutor(Properties properties) throws Exception{
-this(properties,PherfConstants.DEFAULT_FILE_PATTERN);
+public WorkloadExecutor(Properties properties) throws Exception {
+this(properties, new ArrayList());
 }
 
-public WorkloadExecutor(Properties properties, String filePattern) 
throws Exception {
-this(properties,
-new XMLConfigParser(filePattern),
-true);
+public WorkloadExecutor(Properties properties, List 
workloads) throws Exception {
+this.poolSize =
+(properties.getProperty("pherf.default.threadpool") == 
null) ?
+PherfConstants.DEFAULT_THREAD_POOL_SIZE :
+
Integer.parseInt(properties.getProperty("pherf.default.threadpool"));
+
+this.pool = Executors.newFixedThreadPool(this.poolSize);
+init(workloads);
 }
 
-public WorkloadExecutor(Properties properties, XMLConfigParser parser, 
boolean monitor) throws Exception {
-this.parser = parser;
-this.poolSize = 
(properties.getProperty("pherf.default.threadpool") == null)
-? PherfConstants.DEFAULT_THREAD_POOL_SIZE
-: 
Integer.parseInt(properties.getProperty("pherf.default.threadpool"));
+public void add(Workload workload) throws Exception {
+this.jobs.put(workload, pool.submit(workload.execute()));
+}
 
-this.pool = Executors.newFixedThreadPool(this.poolSize);
-if (monitor) {
-
initMonitor(Integer.parseInt(properties.getProperty("pherf.default.monitorFrequency")));
+/**
+ * Blocks on waiting for all workloads to finish. If a
+ * {@link org.apache.phoenix.pherf.workload.Workload} Requires 
complete() to be called, it must
+ * be called prior to using this method. Otherwise it will block 
infinitely.
+ */
+public synchronized void get() {
--- End diff --

The synchronization is probably not needed here unless member variable 
"jobs" is being modified concurrently. In that case you want to have 
synchronization everywhere "jobs" is accessed (both read and modified) (for ex 
- complete() ). It would be also good to add a @GuardedBy("this") annotation 
for "jobs".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Cody Marcel (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593591#comment-14593591
 ] 

Cody Marcel commented on PHOENIX-1920:
--

[~samarthjain] I took care of the comments you made. Let me know if there is 
anything else.

> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-1920) Pherf - Add support for mixed r/w workloads

2015-06-19 Thread Cody Marcel (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593589#comment-14593589
 ] 

Cody Marcel commented on PHOENIX-1920:
--

Please review and let me know if there are any concerns with this.
https://github.com/apache/phoenix/pull/89


> Pherf - Add support for mixed r/w workloads
> ---
>
> Key: PHOENIX-1920
> URL: https://issues.apache.org/jira/browse/PHOENIX-1920
> Project: Phoenix
>  Issue Type: Improvement
>Reporter: Cody Marcel
>Assignee: Cody Marcel
>
> Add the ability to miss workloads for read write.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (PHOENIX-2021) Implement ARRAY_CAT built in function

2015-06-19 Thread Dumindu Buddhika (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dumindu Buddhika updated PHOENIX-2021:
--
Attachment: PHOENIX-2021-v5.patch

Removed some unused import statements.

> Implement ARRAY_CAT built in function
> -
>
> Key: PHOENIX-2021
> URL: https://issues.apache.org/jira/browse/PHOENIX-2021
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Dumindu Buddhika
>Assignee: Dumindu Buddhika
> Attachments: PHOENIX-2021-v3.patch, PHOENIX-2021-v4.patch, 
> PHOENIX-2021-v5.patch, PHOENIX-2021.patch
>
>
> Ex:
> ARRAY_CAT(ARRAY[2, 3, 4], ARRAY[4, 5, 6]) = ARRAY[2,3,4,4,5,6]
> ARRAY_CAT(ARRAY["a", "b"], ARRAY["c", "d"]) = ARRAY["a", "b", "c", "d"]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2021) Implement ARRAY_CAT built in function

2015-06-19 Thread ramkrishna.s.vasudevan (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593361#comment-14593361
 ] 

ramkrishna.s.vasudevan commented on PHOENIX-2021:
-

Okie, viewing the patch with the CHROME extension for viewing .patch files I 
felt so. 
[~giacomotaylor]
You have some feedback on the patch. Pls note that the ArrayPrepend and 
ArrayAppend function code has been refactored for all the pre checks and 
evaluate methods. 
For now only these three ARRAY functions are modifiying the existing ARRAYs. 
The upcoming functionalities are not going to modify the array whereas it is 
only going to use the array to produce some new outputs.
{code}
ARRAY_FILL(element, length) - Returns an array initialized with supplied value 
and length.

ARRAY_TO_STRING(anyarray, text [, text]) - Concatenates array elements using 
supplied delimiter and optional null string and returns the resulting string

STRING_TO_ARRAY(text, text [, text]) - Splits string into array elements using 
supplied delimiter and optional null string and returns the resulting varchar 
array.

UNNEST(anyarray) - Expands an array to a set of rows.
{code}




> Implement ARRAY_CAT built in function
> -
>
> Key: PHOENIX-2021
> URL: https://issues.apache.org/jira/browse/PHOENIX-2021
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Dumindu Buddhika
>Assignee: Dumindu Buddhika
> Attachments: PHOENIX-2021-v3.patch, PHOENIX-2021-v4.patch, 
> PHOENIX-2021.patch
>
>
> Ex:
> ARRAY_CAT(ARRAY[2, 3, 4], ARRAY[4, 5, 6]) = ARRAY[2,3,4,4,5,6]
> ARRAY_CAT(ARRAY["a", "b"], ARRAY["c", "d"]) = ARRAY["a", "b", "c", "d"]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2021) Implement ARRAY_CAT built in function

2015-06-19 Thread Dumindu Buddhika (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593262#comment-14593262
 ] 

Dumindu Buddhika commented on PHOENIX-2021:
---

[~ramkrishna] I checked the formatting. Those are continued lines from the 
above line(not formatting errors).
I have run the tests.

> Implement ARRAY_CAT built in function
> -
>
> Key: PHOENIX-2021
> URL: https://issues.apache.org/jira/browse/PHOENIX-2021
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Dumindu Buddhika
>Assignee: Dumindu Buddhika
> Attachments: PHOENIX-2021-v3.patch, PHOENIX-2021-v4.patch, 
> PHOENIX-2021.patch
>
>
> Ex:
> ARRAY_CAT(ARRAY[2, 3, 4], ARRAY[4, 5, 6]) = ARRAY[2,3,4,4,5,6]
> ARRAY_CAT(ARRAY["a", "b"], ARRAY["c", "d"]) = ARRAY["a", "b", "c", "d"]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2053) The Expression IN has Bug when the params are less than zero

2015-06-19 Thread PeiLiping (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593205#comment-14593205
 ] 

PeiLiping commented on PHOENIX-2053:


Maybe the problem is on ( split on)

> The Expression  IN  has Bug when the params are less than zero
> --
>
> Key: PHOENIX-2053
> URL: https://issues.apache.org/jira/browse/PHOENIX-2053
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.3.0
>Reporter: PeiLiping
>
> drop table test;
> create table test(a integer not null,b integer not null, c integer not null , 
> d integer constraint pk primary key (a,b,c) ) compression='SNAPPY' , 
> TTL=86400  split on (2,3,4,5,6,7,8,9,10);
> upsert into test values (1,-1,1,1) ;
> upsert into test values (2,-2,2,1) ;
> upsert into test values (3,-3,3,1) ;
> upsert into test values (4,-4,4,1) ;
> upsert into test values (5,-5,5,1) ;
> upsert into test values (6,-6,6,1) ;
> select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 5| 1
> |
> +--+--+
> select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 1| 1
> |
> | 2| 1
> |
> | 4| 1
> |
> | 5| 1
> |
> +--+--+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2053) The Expression IN has Bug when the params are less than zero

2015-06-19 Thread PeiLiping (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593192#comment-14593192
 ] 

PeiLiping commented on PHOENIX-2053:


I has updated the Description  

I use the phoenix 4.3.0

> The Expression  IN  has Bug when the params are less than zero
> --
>
> Key: PHOENIX-2053
> URL: https://issues.apache.org/jira/browse/PHOENIX-2053
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.3.0
>Reporter: PeiLiping
>
> drop table test;
> create table test(a integer not null,b integer not null, c integer not null , 
> d integer constraint pk primary key (a,b,c) ) compression='SNAPPY' , 
> TTL=86400  split on (2,3,4,5,6,7,8,9,10);
> upsert into test values (1,-1,1,1) ;
> upsert into test values (2,-2,2,1) ;
> upsert into test values (3,-3,3,1) ;
> upsert into test values (4,-4,4,1) ;
> upsert into test values (5,-5,5,1) ;
> upsert into test values (6,-6,6,1) ;
> select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 5| 1
> |
> +--+--+
> select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 1| 1
> |
> | 2| 1
> |
> | 4| 1
> |
> | 5| 1
> |
> +--+--+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (PHOENIX-2053) The Expression IN has Bug when the params are less than zero

2015-06-19 Thread PeiLiping (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

PeiLiping updated PHOENIX-2053:
---
Description: 
drop table test;
create table test(a integer not null,b integer not null, c integer not null , d 
integer constraint pk primary key (a,b,c) ) compression='SNAPPY' , TTL=86400  
split on (2,3,4,5,6,7,8,9,10);

upsert into test values (1,-1,1,1) ;
upsert into test values (2,-2,2,1) ;
upsert into test values (3,-3,3,1) ;
upsert into test values (4,-4,4,1) ;
upsert into test values (5,-5,5,1) ;
upsert into test values (6,-6,6,1) ;

select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1) group 
by c ;
+--+--+
|C |  SUM(D)
  |
+--+--+
| 5| 1  
  |
+--+--+

select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1) group 
by c ;
+--+--+
|C |  SUM(D)
  |
+--+--+
| 1| 1  
  |
| 2| 1  
  |
| 4| 1  
  |
| 5| 1  
  |
+--+--+


  was:
select * from test where a in (1,2,3 )   is right

select * from test where a in (-1 )  is right 

but  select * from test where a in (-1,-2,-3) is wrong

I think when params are less then zero  the scan range is wrong  


> The Expression  IN  has Bug when the params are less than zero
> --
>
> Key: PHOENIX-2053
> URL: https://issues.apache.org/jira/browse/PHOENIX-2053
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.3.0
>Reporter: PeiLiping
>
> drop table test;
> create table test(a integer not null,b integer not null, c integer not null , 
> d integer constraint pk primary key (a,b,c) ) compression='SNAPPY' , 
> TTL=86400  split on (2,3,4,5,6,7,8,9,10);
> upsert into test values (1,-1,1,1) ;
> upsert into test values (2,-2,2,1) ;
> upsert into test values (3,-3,3,1) ;
> upsert into test values (4,-4,4,1) ;
> upsert into test values (5,-5,5,1) ;
> upsert into test values (6,-6,6,1) ;
> select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 5| 1
> |
> +--+--+
> select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1) 
> group by c ;
> +--+--+
> |C |  SUM(D)  
> |
> +--+--+
> | 1| 1
> |
> | 2| 1
> |
> | 4| 1
> |
> | 5| 1
> |
> +--+--+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (PHOENIX-2052) Division Bug In Group By SQL The result turn to NULL

2015-06-19 Thread PeiLiping (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-2052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

PeiLiping updated PHOENIX-2052:
---
Description: 
when use division in group by sql   the result turn to null

select  a , floor( b/4 ) as t  from test group by a, t
123  null
123   null

select  a , floor( b * 0.25 ) as t  from test group by a, t
123  1
123  2 


  was:
when use division in group by sql   the result turn to null

select  a , floor( b/4 ) as t  from test group by a, t
null   null
null   null

select  a , floor( b * 0.25 ) as t  from test group by a, t
123  1
123  2 



> Division Bug In Group By SQL   The result turn to NULL 
> ---
>
> Key: PHOENIX-2052
> URL: https://issues.apache.org/jira/browse/PHOENIX-2052
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.3.0
> Environment: hbase 0.98 phoenix 4.3 
>Reporter: PeiLiping
>Priority: Critical
>
> when use division in group by sql   the result turn to null
> select  a , floor( b/4 ) as t  from test group by a, t
> 123  null
> 123   null
> select  a , floor( b * 0.25 ) as t  from test group by a, t
> 123  1
> 123  2 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PHOENIX-2052) Division Bug In Group By SQL The result turn to NULL

2015-06-19 Thread PeiLiping (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-2052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593132#comment-14593132
 ] 

PeiLiping commented on PHOENIX-2052:


create table test(a integer not null,b integer constraint pk primary key (a) ) ;
 upsert into test (1,1) ;
 upsert into test (2,2) ;
 upsert into test (3,3) ;

 select * from test ;
+--+--+
|A |B   
  |
+--+--+
| 1| 1  
  |
| 2| 2  
  |
| 3| 3  
  |
+--+--+


select a , floor( b/2 ) as t from test group by a, t ;
+--++
|A |   T
|
+--++
| 1| null   
|
| 2| null   
|
| 3| null   
|
+--++


select a , floor( b*0.5 ) as t from test group by a, t ;
+--+--+
|A |T   
  |
+--+--+
| 1| 0  
  |
| 2| 1  
  |
| 3| 1  
  |
+--+--+




> Division Bug In Group By SQL   The result turn to NULL 
> ---
>
> Key: PHOENIX-2052
> URL: https://issues.apache.org/jira/browse/PHOENIX-2052
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.3.0
> Environment: hbase 0.98 phoenix 4.3 
>Reporter: PeiLiping
>Priority: Critical
>
> when use division in group by sql   the result turn to null
> select  a , floor( b/4 ) as t  from test group by a, t
> null   null
> null   null
> select  a , floor( b * 0.25 ) as t  from test group by a, t
> 123  1
> 123  2 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)