Java Code Examples for org.apache.kylin.common.persistence.ResourceStore#checkAndPutResource()
The following examples show how to use
org.apache.kylin.common.persistence.ResourceStore#checkAndPutResource() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AclTableMigrationTool.java From kylin-on-parquet-v2 with Apache License 2.0 | 6 votes |
private void convertToResourceStore(KylinConfig kylinConfig, String tableName, ResourceStore store, ResultConverter converter) throws IOException { Table table = null; ResultScanner rs = null; Scan scan = new Scan(); try { table = HBaseConnection.get(kylinConfig.getStorageUrl()).getTable(TableName.valueOf(tableName)); rs = table.getScanner(scan); converter.convertResult(rs, store); store.checkAndPutResource(MIGRATE_OK_PREFIX + tableName, new StringEntity(tableName + " migrated"), StringEntity.serializer); } finally { IOUtils.closeQuietly(rs); IOUtils.closeQuietly(table); } }
Example 2
Source File: AclTableMigrationTool.java From kylin with Apache License 2.0 | 6 votes |
private void convertToResourceStore(KylinConfig kylinConfig, String tableName, ResourceStore store, ResultConverter converter) throws IOException { Table table = null; ResultScanner rs = null; Scan scan = new Scan(); try { table = HBaseConnection.get(kylinConfig.getStorageUrl()).getTable(TableName.valueOf(tableName)); rs = table.getScanner(scan); converter.convertResult(rs, store); store.checkAndPutResource(MIGRATE_OK_PREFIX + tableName, new StringEntity(tableName + " migrated"), StringEntity.serializer); } finally { IOUtils.closeQuietly(rs); IOUtils.closeQuietly(table); } }
Example 3
Source File: DraftManager.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
public void save(Draft draft) throws IOException { if (draft.getUuid() == null) { throw new IllegalArgumentException(); } Draft youngerSelf = load(draft.getUuid()); if (youngerSelf != null) { draft.setLastModified(youngerSelf.getLastModified()); } ResourceStore store = getStore(); store.checkAndPutResource(draft.getResourcePath(), draft, DRAFT_SERIALIZER); logger.trace("Saved " + draft); }
Example 4
Source File: DraftManager.java From kylin with Apache License 2.0 | 5 votes |
public void save(Draft draft) throws IOException { if (draft.getUuid() == null) { throw new IllegalArgumentException(); } Draft youngerSelf = load(draft.getUuid()); if (youngerSelf != null) { draft.setLastModified(youngerSelf.getLastModified()); } ResourceStore store = getStore(); store.checkAndPutResource(draft.getResourcePath(), draft, DRAFT_SERIALIZER); logger.trace("Saved " + draft); }
Example 5
Source File: ExtTableSnapshotInfoManager.java From kylin-on-parquet-v2 with Apache License 2.0 | 4 votes |
public void save(ExtTableSnapshotInfo snapshot) throws IOException { ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); String path = snapshot.getResourcePath(); store.checkAndPutResource(path, snapshot, SNAPSHOT_SERIALIZER); }
Example 6
Source File: ExtTableSnapshotInfoManager.java From kylin with Apache License 2.0 | 4 votes |
public void save(ExtTableSnapshotInfo snapshot) throws IOException { ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); String path = snapshot.getResourcePath(); store.checkAndPutResource(path, snapshot, SNAPSHOT_SERIALIZER); }