当前位置: 首页>>代码示例>>Java>>正文


Java StorageException类代码示例

本文整理汇总了Java中org.apache.kylin.common.persistence.StorageException的典型用法代码示例。如果您正苦于以下问题:Java StorageException类的具体用法?Java StorageException怎么用?Java StorageException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StorageException类属于org.apache.kylin.common.persistence包,在下文中一共展示了StorageException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CubeSegmentTupleIterator

import org.apache.kylin.common.persistence.StorageException; //导入依赖的package包/类
public CubeSegmentTupleIterator(CubeSegment cubeSeg, Collection<HBaseKeyRange> keyRanges, HConnection conn, Collection<TblColRef> dimensions, TupleFilter filter, Collection<TblColRef> groupBy, Collection<RowValueDecoder> rowValueDecoders, StorageContext context) {
    this.cube = cubeSeg.getCubeInstance();
    this.cubeSeg = cubeSeg;
    this.dimensions = dimensions;
    this.filter = filter;
    this.groupBy = groupBy;
    this.rowValueDecoders = rowValueDecoders;
    this.context = context;
    this.tableName = cubeSeg.getStorageLocationIdentifier();
    this.rowKeyDecoder = new RowKeyDecoder(this.cubeSeg);
    this.scanCount = 0;

    try {
        this.table = conn.getTable(tableName);
    } catch (Throwable t) {
        throw new StorageException("Error when open connection to table " + tableName, t);
    }
    this.rangeIterator = keyRanges.iterator();
    scanNextRange();
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:21,代码来源:CubeSegmentTupleIterator.java

示例2: closeScanner

import org.apache.kylin.common.persistence.StorageException; //导入依赖的package包/类
private void closeScanner() {
    if (logger.isDebugEnabled() && scan != null) {
        logger.debug("Scan " + scan.toString());
        byte[] metricsBytes = scan.getAttribute(Scan.SCAN_ATTRIBUTES_METRICS_DATA);
        if (metricsBytes != null) {
            ScanMetrics scanMetrics = ProtobufUtil.toScanMetrics(metricsBytes);
            logger.debug("HBase Metrics: " + "count={}, ms={}, bytes={}, remote_bytes={}, regions={}, not_serving_region={}, rpc={}, rpc_retries={}, remote_rpc={}, remote_rpc_retries={}", new Object[] { scanCount, scanMetrics.sumOfMillisSecBetweenNexts, scanMetrics.countOfBytesInResults, scanMetrics.countOfBytesInRemoteResults, scanMetrics.countOfRegions, scanMetrics.countOfNSRE, scanMetrics.countOfRPCcalls, scanMetrics.countOfRPCRetries, scanMetrics.countOfRemoteRPCcalls, scanMetrics.countOfRemoteRPCRetries });
        }
    }
    try {
        if (scanner != null) {
            scanner.close();
            scanner = null;
        }
    } catch (Throwable t) {
        throw new StorageException("Error when close scanner for table " + tableName, t);
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:19,代码来源:CubeSegmentTupleIterator.java

示例3: doScan

import org.apache.kylin.common.persistence.StorageException; //导入依赖的package包/类
private final Iterator<Result> doScan(HBaseKeyRange keyRange) {

        Iterator<Result> iter = null;
        try {
            scan = buildScan(keyRange);
            applyFuzzyFilter(scan, keyRange);
            logScan(keyRange);

            scanner = ObserverEnabler.scanWithCoprocessorIfBeneficial(cubeSeg, keyRange.getCuboid(), filter, groupBy, rowValueDecoders, context, table, scan);

            iter = scanner.iterator();
        } catch (Throwable t) {
            String msg = MessageFormat.format("Error when scan from lower key {1} to upper key {2} on table {0}.", tableName, Bytes.toString(keyRange.getStartKey()), Bytes.toString(keyRange.getStopKey()));
            throw new StorageException(msg, t);
        }
        return iter;
    }
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:18,代码来源:CubeSegmentTupleIterator.java

示例4: get

import org.apache.kylin.common.persistence.StorageException; //导入依赖的package包/类
@SuppressWarnings("resource")
public static Connection get(StorageURL url) {
    // find configuration
    Configuration conf = configCache.get(url);
    if (conf == null) {
        conf = newHBaseConfiguration(url);
        configCache.put(url, conf);
    }

    Connection connection = connPool.get(url);
    try {
        while (true) {
            // I don't use DCL since recreate a connection is not a big issue.
            if (connection == null || connection.isClosed()) {
                logger.info("connection is null or closed, creating a new one");
                connection = ConnectionFactory.createConnection(conf);
                connPool.put(url, connection);
            }

            if (connection == null || connection.isClosed()) {
                Thread.sleep(10000);// wait a while and retry
            } else {
                break;
            }
        }

    } catch (Throwable t) {
        logger.error("Error when open connection " + url, t);
        throw new StorageException("Error when open connection " + url, t);
    }

    return connection;
}
 
开发者ID:apache,项目名称:kylin,代码行数:34,代码来源:HBaseConnection.java

示例5: closeTable

import org.apache.kylin.common.persistence.StorageException; //导入依赖的package包/类
private void closeTable() {
    try {
        if (table != null) {
            table.close();
        }
    } catch (Throwable t) {
        throw new StorageException("Error when close table " + tableName, t);
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:10,代码来源:CubeSegmentTupleIterator.java


注:本文中的org.apache.kylin.common.persistence.StorageException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。