[jira] [Created] (HBASE-10078) Dynamic Filter - Not using DynamicClassLoader whe using FilterList

2013-12-04 Thread Federico Gaule (JIRA)
Federico Gaule created HBASE-10078:
--

 Summary: Dynamic Filter - Not using DynamicClassLoader whe using 
FilterList
 Key: HBASE-10078
 URL: https://issues.apache.org/jira/browse/HBASE-10078
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.13
Reporter: Federico Gaule
Priority: Minor


I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Loading new jar files, if any
2013-12-02 13:55:42,677 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class again: d.p.AFilter
2013-12-02 13:55:43,004 ERROR org.apache.hadoop.hbase.io.HbaseObjectWritable: 
Can't find class d.p.BFilter
java.lang.ClassNotFoundException: d.p.BFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at 
org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:820)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.getClassByName(HbaseObjectWritable.java:792)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:679)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.filter.FilterList.readFields(FilterList.java:324)
at org.apache.hadoop.hbase.client.Get.readFields(Get.java:405)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:126)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1311)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1226)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:748)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:539)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:514)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
AFilter is not found so it tries with DynamicClassLoader, but when it tries to 
load AFilter, it uses URLClassLoader and fails without checking out for dynamic 
jars.


I think the issue is releated to FilterList#readFields 


 public void readFields(final DataInput in) throws IOException {
byte opByte = in.readByte();
operator = Operator.values()[opByte];
int size = in.readInt();
if (size  0) {
  filters = new ArrayListFilter(size);
  for (int i = 0; i  size; i++) {
Filter filter = (Filter)HbaseObjectWritable.readObject(in, conf);
filters.add(filter);
  }
}
  }

HbaseObjectWritable#readObject uses a conf (created by calling 
HBaseConfiguration.create()) which i suppose doesn't include a 
DynamicClassLoader instance.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (HBASE-10078) Dynamic Filter - Not using DynamicClassLoader whe using FilterList

2013-12-04 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-10078:
---

Description: 
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Loading new jar files, if any
2013-12-02 13:55:42,677 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class again: d.p.AFilter
2013-12-02 13:55:43,004 ERROR org.apache.hadoop.hbase.io.HbaseObjectWritable: 
Can't find class d.p.BFilter
java.lang.ClassNotFoundException: d.p.BFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at 
org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:820)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.getClassByName(HbaseObjectWritable.java:792)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:679)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.filter.FilterList.readFields(FilterList.java:324)
at org.apache.hadoop.hbase.client.Get.readFields(Get.java:405)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:126)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1311)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1226)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:748)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:539)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:514)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
AFilter is not found so it tries with DynamicClassLoader, but when it tries to 
load AFilter, it uses URLClassLoader and fails without checking out for dynamic 
jars.


I think the issue is releated to FilterList#readFields

{code:title=FilterList.java|borderStyle=solid} 
 public void readFields(final DataInput in) throws IOException {
byte opByte = in.readByte();
operator = Operator.values()[opByte];
int size = in.readInt();
if (size  0) {
  filters = new ArrayListFilter(size);
  for (int i = 0; i  size; i++) {
Filter filter = (Filter)HbaseObjectWritable.readObject(in, conf);
filters.add(filter);
  }
}
  }
{code}

HbaseObjectWritable#readObject uses a conf (created by calling 
HBaseConfiguration.create()) which i suppose doesn't include a 
DynamicClassLoader instance.

  was:
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG 

[jira] [Updated] (HBASE-10078) Dynamic Filter - Not using DynamicClassLoader whe using FilterList

2013-12-04 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-10078:
---

Description: 
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Loading new jar files, if any
2013-12-02 13:55:42,677 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class again: d.p.AFilter
2013-12-02 13:55:43,004 ERROR org.apache.hadoop.hbase.io.HbaseObjectWritable: 
Can't find class d.p.BFilter
java.lang.ClassNotFoundException: d.p.BFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at 
org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:820)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.getClassByName(HbaseObjectWritable.java:792)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:679)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.filter.FilterList.readFields(FilterList.java:324)
at org.apache.hadoop.hbase.client.Get.readFields(Get.java:405)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:126)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1311)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1226)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:748)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:539)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:514)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
AFilter is not found so it tries with DynamicClassLoader, but when it tries to 
load AFilter, it uses URLClassLoader and fails without checking out for dynamic 
jars.


I think the issue is releated to FilterList#readFields

{code:title=FilterList.java|borderStyle=solid} 

 public void readFields(final DataInput in) throws IOException {
byte opByte = in.readByte();
operator = Operator.values()[opByte];
int size = in.readInt();
if (size  0) {
  filters = new ArrayListFilter(size);
  for (int i = 0; i  size; i++) {
Filter filter = (Filter)HbaseObjectWritable.readObject(in, conf);
filters.add(filter);
  }
}
  }
{code}

HbaseObjectWritable#readObject uses a conf (created by calling 
HBaseConfiguration.create()) which i suppose doesn't include a 
DynamicClassLoader instance.

  was:
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG 

[jira] [Updated] (HBASE-10078) Dynamic Filter - Not using DynamicClassLoader whe using FilterList

2013-12-04 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-10078:
---

Description: 
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

{noformat}
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Loading new jar files, if any
2013-12-02 13:55:42,677 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class again: d.p.AFilter
2013-12-02 13:55:43,004 ERROR org.apache.hadoop.hbase.io.HbaseObjectWritable: 
Can't find class d.p.BFilter
java.lang.ClassNotFoundException: d.p.BFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at 
org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:820)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.getClassByName(HbaseObjectWritable.java:792)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:679)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.filter.FilterList.readFields(FilterList.java:324)
at org.apache.hadoop.hbase.client.Get.readFields(Get.java:405)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
at 
org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
at 
org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
at 
org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:126)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1311)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1226)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:748)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:539)
at 
org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:514)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{noformat}

AFilter is not found so it tries with DynamicClassLoader, but when it tries to 
load AFilter, it uses URLClassLoader and fails without checking out for dynamic 
jars.


I think the issue is releated to FilterList#readFields

{code:title=FilterList.java|borderStyle=solid} 
 public void readFields(final DataInput in) throws IOException {
byte opByte = in.readByte();
operator = Operator.values()[opByte];
int size = in.readInt();
if (size  0) {
  filters = new ArrayListFilter(size);
  for (int i = 0; i  size; i++) {
Filter filter = (Filter)HbaseObjectWritable.readObject(in, conf);
filters.add(filter);
  }
}
  }
{code}

HbaseObjectWritable#readObject uses a conf (created by calling 
HBaseConfiguration.create()) which i suppose doesn't include a 
DynamicClassLoader instance.

  was:
I've tried to use dynamic jar load 
(https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
with FilterList. 
Here is some log from my app where i send a Get with a FilterList containing 
AFilter and other with BFilter.

2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Class d.p.AFilter not found - using dynamical class loader
2013-12-02 13:55:42,564 DEBUG org.apache.hadoop.hbase.util.DynamicClassLoader: 
Finding class: d.p.AFilter
2013-12-02 13:55:42,564 DEBUG 

[jira] [Updated] (HBASE-10078) Dynamic Filter - Not using DynamicClassLoader when using FilterList

2013-12-04 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-10078:
---

Summary: Dynamic Filter - Not using DynamicClassLoader when using 
FilterList  (was: Dynamic Filter - Not using DynamicClassLoader whe using 
FilterList)

 Dynamic Filter - Not using DynamicClassLoader when using FilterList
 ---

 Key: HBASE-10078
 URL: https://issues.apache.org/jira/browse/HBASE-10078
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.13
Reporter: Federico Gaule
Priority: Minor

 I've tried to use dynamic jar load 
 (https://issues.apache.org/jira/browse/HBASE-1936) but seems to have an issue 
 with FilterList. 
 Here is some log from my app where i send a Get with a FilterList containing 
 AFilter and other with BFilter.
 {noformat}
 2013-12-02 13:55:42,564 DEBUG 
 org.apache.hadoop.hbase.util.DynamicClassLoader: Class d.p.AFilter not found 
 - using dynamical class loader
 2013-12-02 13:55:42,564 DEBUG 
 org.apache.hadoop.hbase.util.DynamicClassLoader: Finding class: d.p.AFilter
 2013-12-02 13:55:42,564 DEBUG 
 org.apache.hadoop.hbase.util.DynamicClassLoader: Loading new jar files, if any
 2013-12-02 13:55:42,677 DEBUG 
 org.apache.hadoop.hbase.util.DynamicClassLoader: Finding class again: 
 d.p.AFilter
 2013-12-02 13:55:43,004 ERROR org.apache.hadoop.hbase.io.HbaseObjectWritable: 
 Can't find class d.p.BFilter
 java.lang.ClassNotFoundException: d.p.BFilter
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at 
 org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:820)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.getClassByName(HbaseObjectWritable.java:792)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:679)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
   at 
 org.apache.hadoop.hbase.filter.FilterList.readFields(FilterList.java:324)
   at org.apache.hadoop.hbase.client.Get.readFields(Get.java:405)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
   at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:594)
   at 
 org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
   at 
 org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:690)
   at 
 org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:126)
   at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1311)
   at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1226)
   at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:748)
   at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:539)
   at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:514)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:662)
 {noformat}
 AFilter is not found so it tries with DynamicClassLoader, but when it tries 
 to load AFilter, it uses URLClassLoader and fails without checking out for 
 dynamic jars.
 I think the issue is releated to FilterList#readFields
 {code:title=FilterList.java|borderStyle=solid} 
  public void readFields(final DataInput in) throws IOException {
 byte opByte = in.readByte();
 operator = Operator.values()[opByte];
 int size = in.readInt();
 if (size  0) {
   filters = new ArrayListFilter(size);
   for (int i = 0; i  size; i++) {
 Filter filter = (Filter)HbaseObjectWritable.readObject(in, conf);
 filters.add(filter);
   }
 }
   }
 {code}
 HbaseObjectWritable#readObject uses a conf (created by calling 
 HBaseConfiguration.create()) which 

[jira] [Commented] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-08-21 Thread Federico Gaule (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-8930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13747002#comment-13747002
 ] 

Federico Gaule commented on HBASE-8930:
---

@Vasu, this is what i was looking for since a long time ago. Summarizing, 
without the fix being applied, if you donĀ“t narrow columns using a filter (i.e. 
ColumnRangeFilter), filters can go till the last column in case they match the 
Filters. Am i Right?


 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Assignee: Vasu Mariyala
Priority: Critical
  Labels: filters, hbase, keyvalue
 Attachments: HBASE-8930.patch


 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 

[jira] [Commented] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-08-21 Thread Federico Gaule (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-8930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13747042#comment-13747042
 ] 

Federico Gaule commented on HBASE-8930:
---

[~vasu.pulip...@yellowshirt.com] You made my day. Hope to have the patch 
applied for next release.
 


 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Assignee: Vasu Mariyala
Priority: Critical
  Labels: filters, hbase, keyvalue
 Attachments: HBASE-8930.patch


 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 get.addColumn(cf, col2); //5591
 get.addColumn(cf, col2v); //5594
 get.addColumn(cf, col2g); //5596
 
 

[jira] [Commented] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-08-21 Thread Federico Gaule (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-8930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13747047#comment-13747047
 ] 

Federico Gaule commented on HBASE-8930:
---

Got my answers. Thanks

 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Assignee: Vasu Mariyala
Priority: Critical
  Labels: filters, hbase, keyvalue
 Attachments: HBASE-8930.patch


 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 get.addColumn(cf, col2); //5591
 get.addColumn(cf, col2v); //5594
 get.addColumn(cf, col2g); //5596
 
 get.setFilter(allwaysNextColFilter);
 get.setMaxVersions(1);
 System.out.println(get);
 

[jira] [Commented] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-08-15 Thread Federico Gaule (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-8930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13741284#comment-13741284
 ] 

Federico Gaule commented on HBASE-8930:
---

Thanks @Lars, 

I have a question in mind about how does HBase decide what KVs to pickup, what 
is the strategy to get KVs that are passed to Filters? Does it pass all Store 
KVs matching rowkey or do some previous filtering? Cause i have lot of cases 
where filters only receive requested columns(qualifiers) and other (like the 
case) that receive more than requested. 

Thanks. 

 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Priority: Critical
  Labels: filters, hbase, keyvalue

 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 

[jira] [Created] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)
Federico Gaule created HBASE-8930:
-

 Summary: Filter evaluates KVs outside requested columns
 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Priority: Critical




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, fgaule-despegar);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);

hTable.flushCommits();

Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, fgaule-despegar);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);

hTable.flushCommits();

Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, fgaule-despegar);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);

hTable.flushCommits();

Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);

hTable.flushCommits();

Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, fgaule-despegar);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);

hTable.flushCommits();

Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

MINIMUM_RELEASE_DAYS = 0
MINIMUM_RESERVATION_DAYS = 1
VARIABLE_ALLOTMENT = 4
GUARANTEE_ALLOTMENT = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  P   |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


code

public class ExtraColumnTest {

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

MINIMUM_RELEASE_DAYS = 0
MINIMUM_RESERVATION_DAYS = 1
VARIABLE_ALLOTMENT = 4
GUARANTEE_ALLOTMENT = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  P   |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

MINIMUM_RELEASE_DAYS = 0
MINIMUM_RESERVATION_DAYS = 1
VARIABLE_ALLOTMENT = 4
GUARANTEE_ALLOTMENT = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  P   |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

MINIMUM_RELEASE_DAYS = 0
MINIMUM_RESERVATION_DAYS = 1
VARIABLE_ALLOTMENT = 4
GUARANTEE_ALLOTMENT = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  P   |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

MINIMUM_RELEASE_DAYS = 0
MINIMUM_RESERVATION_DAYS = 1
VARIABLE_ALLOTMENT = 4
GUARANTEE_ALLOTMENT = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  P   |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col2 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col3 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col4 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col5 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));
byte[] col6 = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.MINIMUM_RESERVATION_DAYS));


byte[] col1g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));
byte[] col2g = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.GUARANTEE_ALLOTMENT));

byte[] col1v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col2v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col3v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col4v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col5v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));
byte[] col6v = new 
AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563,
AvailabilityQualifierType.VARIABLE_ALLOTMENT));


new AvailabilityQualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558,
AvailabilityQualifierType.MINIMUM_RELEASE_DAYS));

Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter releaseDayAvailabilityFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(releaseDayAvailabilityFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);
while (iterator.hasNext()) {
Result next = iterator.next();
for 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL and 
prints KV's qualifier

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, availability);
byte[] cf = new 
AvailabilityColumnFamilyConverter().objectToByteArray(new 
AvailabilityColumnFamily('H',
AvailabilityColumnFamilyType.SEARCH));
AvailabilityRowKey availabilityRowKey = 
AvailabilityRowKeyBuilder.create().setCityOID(6846).setContractOID(15642)
.setHotelOID(351802).setRoomTypeOID(41048).build();
byte[] row = new 
AvailabilityRowKeyByteConverter().objectToByteArray(availabilityRowKey);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
AvailabilityQualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter allwaysNextColFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(allwaysNextColFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL and 
prints KV's qualifier

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, testTable);
byte[] cf = Bytes.toBytes(cf);
byte[] row = Bytes.toBytes(row);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter allwaysNextColFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(allwaysNextColFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);
while (iterator.hasNext()) {
Result next = iterator.next();
for (KeyValue kv : next.list()) {
System.out.println(new 
QualifierConverter().byteArrayToObject(kv.getQualifier()));
}
}
}

}

{code}

Sysout Filter
{noformat}

\x00\x00\x1A\xBE\x00\x05^:\x00\x00\xA0X\x00\x00=\x1A/H0:\x02.\x01/1373577819267/Put/vlen=2/ts=2
Qualifier{date=558, type=SUFFIX_1}
\x00\x00\x1A\xBE\x00\x05^:\x00\x00\xA0X\x00\x00=\x1A/H0:\x02.\x02/1373577819272/Put/vlen=2/ts=3
Qualifier{date=558, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL and 
prints KV's qualifier

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, testTable);
byte[] cf = Bytes.toBytes(cf);
byte[] row = Bytes.toBytes(row);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter allwaysNextColFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1);
get.addColumn(cf, col2);
get.addColumn(cf, col1v);
get.addColumn(cf, col2v);
get.addColumn(cf, col1g);
get.addColumn(cf, col2g);
get.setFilter(allwaysNextColFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);
while (iterator.hasNext()) {
Result next = iterator.next();
for (KeyValue kv : next.list()) {
System.out.println(new 
QualifierConverter().byteArrayToObject(kv.getQualifier()));
}
}
}

}

{code}

Requested 5581 5584 5586 5591 5594 5596
NOT REQUESTED: 5561

Sysout Filter
{noformat}

\x00\x00\x1A\xBE\x00\x05^:\x00\x00\xA0X\x00\x00=\x1A/H0:\x02.\x01/1373577819267/Put/vlen=2/ts=2
Qualifier{date=558, type=SUFFIX_1}

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL and 
prints KV's qualifier

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  
{color:red}E{color}   |  |  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, testTable);
byte[] cf = Bytes.toBytes(cf);
byte[] row = Bytes.toBytes(row);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter allwaysNextColFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1); //5581
get.addColumn(cf, col1v); //5584
get.addColumn(cf, col1g); //5586
get.addColumn(cf, col2); //5591
get.addColumn(cf, col2v); //5594
get.addColumn(cf, col2g); //5596

get.setFilter(allwaysNextColFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);
while (iterator.hasNext()) {
Result next = iterator.next();
for (KeyValue kv : next.list()) {
System.out.println(new 
QualifierConverter().byteArrayToObject(kv.getQualifier()));
}
}
}

}

{code}

Requested 5581 5584 5586 5591 5594 5596
NOT REQUESTED: 5561

Sysout Filter
{noformat}

\x00\x00\x1A\xBE\x00\x05^:\x00\x00\xA0X\x00\x00=\x1A/H0:\x02.\x01/1373577819267/Put/vlen=2/ts=2
Qualifier{date=558, 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Description: 
1- Fill row with some columns
2- Get row with some columns less than universe - Use filter to print kvs
3- Filter prints not requested columns

Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL and 
prints KV's qualifier

SUFFIX_0 = 0
SUFFIX_1 = 1
SUFFIX_4 = 4
SUFFIX_6 = 6

P= Persisted
R= Requested
E= Evaluated
X= Returned
| 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 | 
5606 |... 
|  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  |  
|...
|  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  |  
|...
|  |  E   |   E  |  |  |  E   |   E  |  |  |  *E*   |  
|  |...
|  |  X   |   X  |  |  |  X   |   X  |  |  |  |  |  
|


{code:title=ExtraColumnTest.java|borderStyle=solid}

@Test
public void testFilter() throws Exception {

Configuration config = HBaseConfiguration.create();
config.set(hbase.zookeeper.quorum, myZK);

HTable hTable = new HTable(config, testTable);
byte[] cf = Bytes.toBytes(cf);
byte[] row = Bytes.toBytes(row);


byte[] col1 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_1));
byte[] col2 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_1));
byte[] col3 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_1));
byte[] col4 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_1));
byte[] col5 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_1));
byte[] col6 = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_1));


byte[] col1g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_6));
byte[] col2g = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_6));

byte[] col1v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 558, (byte) SUFFIX_4));
byte[] col2v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 559, (byte) SUFFIX_4));
byte[] col3v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 560, (byte) SUFFIX_4));
byte[] col4v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 561, (byte) SUFFIX_4));
byte[] col5v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 562, (byte) SUFFIX_4));
byte[] col6v = new QualifierConverter().objectToByteArray(new 
Qualifier((short) 563, (byte) SUFFIX_4));

// === INSERTION =//
Put put = new Put(row);
put.add(cf, col1, Bytes.toBytes((short) 1));
put.add(cf, col2, Bytes.toBytes((short) 1));
put.add(cf, col3, Bytes.toBytes((short) 3));
put.add(cf, col4, Bytes.toBytes((short) 3));
put.add(cf, col5, Bytes.toBytes((short) 3));
put.add(cf, col6, Bytes.toBytes((short) 3));
hTable.put(put);

put = new Put(row);
put.add(cf, col1v, Bytes.toBytes((short) 10));
put.add(cf, col2v, Bytes.toBytes((short) 10));
put.add(cf, col3v, Bytes.toBytes((short) 10));
put.add(cf, col4v, Bytes.toBytes((short) 10));
put.add(cf, col5v, Bytes.toBytes((short) 10));
put.add(cf, col6v, Bytes.toBytes((short) 10));

hTable.put(put);
hTable.flushCommits();

//==READING=//
Filter allwaysNextColFilter = new AllwaysNextColFilter();

Get get = new Get(row);
get.addColumn(cf, col1); //5581
get.addColumn(cf, col1v); //5584
get.addColumn(cf, col1g); //5586
get.addColumn(cf, col2); //5591
get.addColumn(cf, col2v); //5594
get.addColumn(cf, col2g); //5596

get.setFilter(allwaysNextColFilter);
get.setMaxVersions(1);
System.out.println(get);

Scan scan = new Scan(get);

ResultScanner scanner = hTable.getScanner(scan);
IteratorResult iterator = scanner.iterator();

System.out.println(SCAN);
while (iterator.hasNext()) {
Result next = iterator.next();
for (KeyValue kv : next.list()) {
System.out.println(new 
QualifierConverter().byteArrayToObject(kv.getQualifier()));
}
}
}

}

{code}

Requested 5581 5584 5586 5591 5594 5596
NOT REQUESTED: 5561

Sysout Filter
{noformat}

\x00\x00\x1A\xBE\x00\x05^:\x00\x00\xA0X\x00\x00=\x1A/H0:\x02.\x01/1373577819267/Put/vlen=2/ts=2
Qualifier{date=558, type=SUFFIX_1}

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Labels: filters hbase keyvalue  (was: )

 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Priority: Critical
  Labels: filters, hbase, keyvalue

 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 get.addColumn(cf, col2); //5591
 get.addColumn(cf, col2v); //5594
 get.addColumn(cf, col2g); //5596
 
 get.setFilter(allwaysNextColFilter);
 get.setMaxVersions(1);
 System.out.println(get);
 Scan scan = new Scan(get);
 ResultScanner scanner = hTable.getScanner(scan);
 IteratorResult iterator 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Priority: Critical  (was: Major)

 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
Priority: Critical
  Labels: filters, hbase, keyvalue

 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 get.addColumn(cf, col2); //5591
 get.addColumn(cf, col2v); //5594
 get.addColumn(cf, col2g); //5596
 
 get.setFilter(allwaysNextColFilter);
 get.setMaxVersions(1);
 System.out.println(get);
 Scan scan = new Scan(get);
 ResultScanner scanner = hTable.getScanner(scan);
 IteratorResult iterator = 

[jira] [Updated] (HBASE-8930) Filter evaluates KVs outside requested columns

2013-07-11 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-8930:
--

Priority: Major  (was: Critical)

 Filter evaluates KVs outside requested columns
 --

 Key: HBASE-8930
 URL: https://issues.apache.org/jira/browse/HBASE-8930
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.94.7
Reporter: Federico Gaule
  Labels: filters, hbase, keyvalue

 1- Fill row with some columns
 2- Get row with some columns less than universe - Use filter to print kvs
 3- Filter prints not requested columns
 Filter (AllwaysNextColFilter) always return ReturnCode.INCLUDE_AND_NEXT_COL 
 and prints KV's qualifier
 SUFFIX_0 = 0
 SUFFIX_1 = 1
 SUFFIX_4 = 4
 SUFFIX_6 = 6
 P= Persisted
 R= Requested
 E= Evaluated
 X= Returned
 | 5580 | 5581 | 5584 | 5586 | 5590 | 5591 | 5594 | 5596 | 5600 | 5601 | 5604 
 | 5606 |... 
 |  |  P   |   P  |  |  |  P   |   P  |  |  |  P   |   P  
 |  |...
 |  |  R   |   R  |   R  |  |  R   |   R  |   R  |  |  |  
 |  |...
 |  |  E   |   E  |  |  |  E   |   E  |  |  |  
 {color:red}E{color}   |  |  |...
 |  |  X   |   X  |  |  |  X   |   X  |  |  |  |  
 |  |
 {code:title=ExtraColumnTest.java|borderStyle=solid}
 @Test
 public void testFilter() throws Exception {
 Configuration config = HBaseConfiguration.create();
 config.set(hbase.zookeeper.quorum, myZK);
 HTable hTable = new HTable(config, testTable);
 byte[] cf = Bytes.toBytes(cf);
 byte[] row = Bytes.toBytes(row);
 byte[] col1 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_1));
 byte[] col2 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_1));
 byte[] col3 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_1));
 byte[] col4 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_1));
 byte[] col5 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_1));
 byte[] col6 = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_1));
 byte[] col1g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_6));
 byte[] col2g = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_6));
 byte[] col1v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 558, (byte) SUFFIX_4));
 byte[] col2v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 559, (byte) SUFFIX_4));
 byte[] col3v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 560, (byte) SUFFIX_4));
 byte[] col4v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 561, (byte) SUFFIX_4));
 byte[] col5v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 562, (byte) SUFFIX_4));
 byte[] col6v = new QualifierConverter().objectToByteArray(new 
 Qualifier((short) 563, (byte) SUFFIX_4));
 // === INSERTION =//
 Put put = new Put(row);
 put.add(cf, col1, Bytes.toBytes((short) 1));
 put.add(cf, col2, Bytes.toBytes((short) 1));
 put.add(cf, col3, Bytes.toBytes((short) 3));
 put.add(cf, col4, Bytes.toBytes((short) 3));
 put.add(cf, col5, Bytes.toBytes((short) 3));
 put.add(cf, col6, Bytes.toBytes((short) 3));
 hTable.put(put);
 put = new Put(row);
 put.add(cf, col1v, Bytes.toBytes((short) 10));
 put.add(cf, col2v, Bytes.toBytes((short) 10));
 put.add(cf, col3v, Bytes.toBytes((short) 10));
 put.add(cf, col4v, Bytes.toBytes((short) 10));
 put.add(cf, col5v, Bytes.toBytes((short) 10));
 put.add(cf, col6v, Bytes.toBytes((short) 10));
 hTable.put(put);
 hTable.flushCommits();
 //==READING=//
 Filter allwaysNextColFilter = new AllwaysNextColFilter();
 Get get = new Get(row);
 get.addColumn(cf, col1); //5581
 get.addColumn(cf, col1v); //5584
 get.addColumn(cf, col1g); //5586
 get.addColumn(cf, col2); //5591
 get.addColumn(cf, col2v); //5594
 get.addColumn(cf, col2g); //5596
 
 get.setFilter(allwaysNextColFilter);
 get.setMaxVersions(1);
 System.out.println(get);
 Scan scan = new Scan(get);
 ResultScanner scanner = hTable.getScanner(scan);
 IteratorResult iterator = scanner.iterator();
 

[jira] [Commented] (HBASE-3562) ValueFilter is being evaluated before performing the column match

2013-07-10 Thread Federico Gaule (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-3562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13704813#comment-13704813
 ] 

Federico Gaule commented on HBASE-3562:
---

Hi everyone, 
I'm facing a similar issue. 
I'm requesting a number of contiguous columns using #addColumn and a FilterList 
expecting to be applied to the columns i request. But, the filters are being 
applied to all columns PLUS the next one to the last one i requested. 

As Workaround, setting a ColumnRangeFilter seems to solve the problem.   

 ValueFilter is being evaluated before performing the column match
 -

 Key: HBASE-3562
 URL: https://issues.apache.org/jira/browse/HBASE-3562
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.90.0
Reporter: Evert Arckens
 Attachments: HBASE-3562.patch


 When performing a Get operation where a both a column is specified and a 
 ValueFilter, the ValueFilter is evaluated before making the column match as 
 is indicated in the javadoc of Get.setFilter()  :  {@link 
 Filter#filterKeyValue(KeyValue)} is called AFTER all tests for ttl, column 
 match, deletes and max versions have been run. 
 The is shown in the little test below, which uses a TestComparator extending 
 a WritableByteArrayComparable.
 public void testFilter() throws Exception {
   byte[] cf = Bytes.toBytes(cf);
   byte[] row = Bytes.toBytes(row);
   byte[] col1 = Bytes.toBytes(col1);
   byte[] col2 = Bytes.toBytes(col2);
   Put put = new Put(row);
   put.add(cf, col1, new byte[]{(byte)1});
   put.add(cf, col2, new byte[]{(byte)2});
   table.put(put);
   Get get = new Get(row);
   get.addColumn(cf, col2); // We only want to retrieve col2
   TestComparator testComparator = new TestComparator();
   Filter filter = new ValueFilter(CompareOp.EQUAL, testComparator);
   get.setFilter(filter);
   Result result = table.get(get);
 }
 public class TestComparator extends WritableByteArrayComparable {
 /**
  * Nullary constructor, for Writable
  */
 public TestComparator() {
 super();
 }
 
 @Override
 public int compareTo(byte[] theirValue) {
 if (theirValue[0] == (byte)1) {
 // If the column match was done before evaluating the filter, we 
 should never get here.
 throw new RuntimeException(I only expect (byte)2 in col2, not 
 (byte)1 from col1);
 }
 if (theirValue[0] == (byte)2) {
 return 0;
 }
 else return 1;
 }
 }
 When only one column should be retrieved, this can be worked around by using 
 a SingleColumnValueFilter instead of the ValueFilter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (HBASE-3562) ValueFilter is being evaluated before performing the column match

2013-07-10 Thread Federico Gaule (JIRA)

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

Federico Gaule updated HBASE-3562:
--

Affects Version/s: 0.94.7

 ValueFilter is being evaluated before performing the column match
 -

 Key: HBASE-3562
 URL: https://issues.apache.org/jira/browse/HBASE-3562
 Project: HBase
  Issue Type: Bug
  Components: Filters
Affects Versions: 0.90.0, 0.94.7
Reporter: Evert Arckens
 Attachments: HBASE-3562.patch


 When performing a Get operation where a both a column is specified and a 
 ValueFilter, the ValueFilter is evaluated before making the column match as 
 is indicated in the javadoc of Get.setFilter()  :  {@link 
 Filter#filterKeyValue(KeyValue)} is called AFTER all tests for ttl, column 
 match, deletes and max versions have been run. 
 The is shown in the little test below, which uses a TestComparator extending 
 a WritableByteArrayComparable.
 public void testFilter() throws Exception {
   byte[] cf = Bytes.toBytes(cf);
   byte[] row = Bytes.toBytes(row);
   byte[] col1 = Bytes.toBytes(col1);
   byte[] col2 = Bytes.toBytes(col2);
   Put put = new Put(row);
   put.add(cf, col1, new byte[]{(byte)1});
   put.add(cf, col2, new byte[]{(byte)2});
   table.put(put);
   Get get = new Get(row);
   get.addColumn(cf, col2); // We only want to retrieve col2
   TestComparator testComparator = new TestComparator();
   Filter filter = new ValueFilter(CompareOp.EQUAL, testComparator);
   get.setFilter(filter);
   Result result = table.get(get);
 }
 public class TestComparator extends WritableByteArrayComparable {
 /**
  * Nullary constructor, for Writable
  */
 public TestComparator() {
 super();
 }
 
 @Override
 public int compareTo(byte[] theirValue) {
 if (theirValue[0] == (byte)1) {
 // If the column match was done before evaluating the filter, we 
 should never get here.
 throw new RuntimeException(I only expect (byte)2 in col2, not 
 (byte)1 from col1);
 }
 if (theirValue[0] == (byte)2) {
 return 0;
 }
 else return 1;
 }
 }
 When only one column should be retrieved, this can be worked around by using 
 a SingleColumnValueFilter instead of the ValueFilter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira