@Test public void testHBaseStoreWithLargeCell() throws Exception { String path = "/cube/_test_large_cell.json"; String largeContent = "THIS_IS_A_LARGE_CELL"; StringEntity content = new StringEntity(largeContent); KylinConfig config = KylinConfig.getInstanceFromEnv(); int origSize = config.getHBaseKeyValueSize(); ResourceStore store = ResourceStore.getStore(KylinConfig.getInstanceFromEnv()); try { config.setProperty("kylin.hbase.client.keyvalue.maxsize", String.valueOf(largeContent.length() - 1)); store.deleteResource(path); store.putResource(path, content, StringEntity.serializer); assertTrue(store.exists(path)); StringEntity t = store.getResource(path, StringEntity.class, StringEntity.serializer); assertEquals(content, t); Path redirectPath = ((HBaseResourceStore) store).bigCellHDFSPath(path); Configuration hconf = HadoopUtil.getCurrentConfiguration(); FileSystem fileSystem = FileSystem.get(hconf); assertTrue(fileSystem.exists(redirectPath)); FSDataInputStream in = fileSystem.open(redirectPath); assertEquals(largeContent, in.readUTF()); in.close(); store.deleteResource(path); } finally { config.setProperty("kylin.hbase.client.keyvalue.maxsize", "" + origSize); store.deleteResource(path); } }
public Path bigCellHDFSPath(String resPath) { String hdfsWorkingDirectory = this.kylinConfig.getHdfsWorkingDirectory(); Path redirectPath = new Path(hdfsWorkingDirectory, "resources" + resPath); return redirectPath; }
HBaseResourceStore extends ResourceStore { public Path bigCellHDFSPath(String resPath) { String hdfsWorkingDirectory = this.kylinConfig.getHdfsWorkingDirectory(); Path redirectPath = new Path(hdfsWorkingDirectory, "resources" + resPath); return redirectPath; } }
HBaseResourceStore extends ResourceStore { public Path bigCellHDFSPath(String resPath) { String hdfsWorkingDirectory = this.kylinConfig.getHdfsWorkingDirectory(); Path redirectPath = new Path(hdfsWorkingDirectory, "resources" + resPath); return redirectPath; } HBaseResourceStore(KylinConfig kylinConfig); }
HBaseResourceStore extends ResourceStore { public Path bigCellHDFSPath(String resPath) { String hdfsWorkingDirectory = this.kylinConfig.getHdfsWorkingDirectory(); Path redirectPath = new Path(hdfsWorkingDirectory, "resources" + resPath); return redirectPath; } HBaseResourceStore(KylinConfig kylinConfig); Path bigCellHDFSPath(String resPath); }
HBaseResourceStore extends ResourceStore { public Path bigCellHDFSPath(String resPath) { String hdfsWorkingDirectory = this.kylinConfig.getHdfsWorkingDirectory(); Path redirectPath = new Path(hdfsWorkingDirectory, "resources" + resPath); return redirectPath; } HBaseResourceStore(KylinConfig kylinConfig); Path bigCellHDFSPath(String resPath);  }