Enis Soztutar created HBASE-17538:
-------------------------------------

             Summary: HFS.setStoragePolicy() logs errors on local fs
                 Key: HBASE-17538
                 URL: https://issues.apache.org/jira/browse/HBASE-17538
             Project: HBase
          Issue Type: Bug
            Reporter: Enis Soztutar


On a master pseudo-cluster running on local disk, the log contains a lot of 
these: 
{code}
2017-01-25 12:30:41,542 WARN  [StoreOpener-32976c3c9b7c28ad632c041da486bfc3-1] 
fs.HFileSystem: Failed to set storage policy of 
[file:/var/folders/h5/bbxg50c12r5bhsd9hf1n9hlr0000gp/T/hbase-enis/hbase/dat
java.lang.UnsupportedOperationException: Cannot find specified method 
setStoragePolicy
  at 
org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:209)
  at 
org.apache.hadoop.hbase.fs.HFileSystem.setStoragePolicy(HFileSystem.java:161)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at 
org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:207)
  at 
org.apache.hadoop.hbase.regionserver.HRegionFileSystem.setStoragePolicy(HRegionFileSystem.java:198)
  at org.apache.hadoop.hbase.regionserver.HStore.<init>(HStore.java:237)
  at 
org.apache.hadoop.hbase.regionserver.HRegion.instantiateHStore(HRegion.java:5265)
  at org.apache.hadoop.hbase.regionserver.HRegion$1.call(HRegion.java:988)
  at org.apache.hadoop.hbase.regionserver.HRegion$1.call(HRegion.java:985)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: 
org.apache.hadoop.fs.LocalFileSystem.setStoragePolicy(org.apache.hadoop.fs.Path,
 java.lang.String)
  at java.lang.Class.getMethod(Class.java:1786)
  at 
org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:205)
  ... 17 more
{code}

These are coming from HFS.setStoragePolicy() or HRegionFS.setStoragePolicy() . 

This check: 
{code}
try {
      ReflectionUtils.invokeMethod(this.fs, "setStoragePolicy", storeDir, 
policyName);
    } catch (Exception e) {
      if (!(this.fs instanceof LocalFileSystem)) {
        LOG.warn("Failed to set storage policy of [" + storeDir + "] to [" + 
policyName + "]", e);
      }
    }
{code} 
does not work, because fs is not a LocalFS, but an HFS. And HFS internally does 
not do this check. seStoragePolicy() is very HDFS specific, the logic should 
instead check whether the underlying fs is HDFS (as opposed to checking whether 
it is not local FS). There are file systems that HBase supports other than 
local or HDFS. 



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

Reply via email to