本文整理了Java中org.archive.format.gzip.zipnum.ZipNumCluster
类的一些代码示例,展示了ZipNumCluster
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipNumCluster
类的具体详情如下:
包路径:org.archive.format.gzip.zipnum.ZipNumCluster
类名称:ZipNumCluster
暂无
代码示例来源:origin: org.netpreserve.commons/commons-web
public long computeTotalLines()
{
long numLines = 0;
try {
numLines = this.getNumLines(summary.getRange("", ""));
} catch (IOException e) {
LOGGER.warning(e.toString());
return 0;
}
long adjustment = getTotalAdjustment();
numLines -= (getNumBlocks() - 1);
numLines *= this.getCdxLinesPerBlock();
numLines += adjustment;
return numLines;
}
代码示例来源:origin: iipc/webarchive-commons
@Override
SeekableLineReader doBlockLoad(String partId, long startOffset, int totalLength) {
SeekableLineReader reader = null;
String[] locations = getLocations(partId);
if (locations == null) {
LOGGER.severe("No locations for block(" + partId +")");
return null;
}
// Attempt cached load for http
if (cacheRemoteLoc && (locCacheMap != null) && (locations.length > 0) && GeneralURIStreamFactory.isHttp(locations[0])) {
reader = loadCachedBalancedReader(partId, locations, startOffset, totalLength);
} else {
// Standard block load path
for (String location : locations) {
reader = blockLoader.attemptLoadBlock(location, startOffset, totalLength, true, isRequired());
if (reader != null) {
return reader;
}
}
}
return reader;
}
代码示例来源:origin: org.netpreserve.commons/commons-web
loadPartLocations(destMap);
} catch (IOException e) {
LOGGER.warning(e.toString());
this.loadLastBlockSizes(blockSizesFile);
locRoot = newLocRoot;
this.cdxLinesTotalCount = computeTotalLines();
closeExistingFiles(filesToClose);
代码示例来源:origin: iipc/openwayback
long numLines = 0;
if (cluster.isDisabled()) {
return 0;
numLines = cluster.getTotalLines();
if (numLines > 0) {
return numLines;
String[] startAndEndBlocks = cluster.getSummary().getRange(start, end);
numLines = cluster.getNumLines(startAndEndBlocks);
adjustment = cluster.getLastBlockDiff(startTokens[0],
startPart, endPart);
blocklines = cluster.getCDXIterator(new CachedStringIterator(
startAndEndBlocks[0], startAndEndBlocks[1]), start, end, 0,
1);
numLines *= cluster.getCdxLinesPerBlock();
numLines += count;
numLines += adjustment;
代码示例来源:origin: org.netpreserve.commons/commons-web
String cachedUrl = locCacheGet(partId);
boolean required = (isRequired() && (i == lastIndex));
locCachePut(partId, connectedUrl);
代码示例来源:origin: org.netpreserve.commons/webarchive-commons
lastModTime = locReaderFactory.getModTime();
loadPartLocations(locMap);
endDate = newEndDate;
locRoot = newLocRoot;
this.cdxLinesTotalCount = computeTotalLines();
this.loadLastBlockSizes(blockSizesFile);
代码示例来源:origin: org.netpreserve.openwayback/openwayback-cdx-server
PageResult pageResult = zipnumSource.getNthPage(startEndUrl,
query.page, query.pageSize, query.showNumPages);
String zipnumClusterUri = zipnumSource.getLocRoot();
} else {
responseWriter.setMaxLines(
query.pageSize * zipnumSource.getCdxLinesPerBlock(),
zipnumClusterUri);
代码示例来源:origin: org.netpreserve.commons/webarchive-commons
public long getLastBlockDiff(String startKey, int startPart, int endPart) {
if (startPart >= lastBlockSizes.length || endPart >= lastBlockSizes.length) {
return 0;
}
if (startKey.equals(lastBlockSizes[startPart].urltimestamp)) {
startPart++;
}
long diff = 0;
for (int i = startPart; i < endPart; i++) {
diff += lastBlockSizes[i].count;
diff -= this.getCdxLinesPerBlock();
}
return diff;
}
代码示例来源:origin: org.netpreserve.commons/webarchive-commons
public CloseableIterator<String> getCDXIterator(String key, String start, String end, ZipNumParams params) throws IOException {
if (!dateRangeCheck(key)) {
return EMPTY_ITERATOR;
}
return super.getCDXIterator(key, start, end, params);
}
代码示例来源:origin: iipc/openwayback
} catch (ResourceIndexNotAvailableException e) {
if (source instanceof ZipNumClusterSearchResultSource) {
if (((ZipNumClusterSearchResultSource)source).getCluster().isRequired()) {
throw e;
代码示例来源:origin: iipc/openwayback
prefix = prefix.substring(0, space);
cdxIter = cluster.getCDXIterator(urlkey, prefix, true, oneBlockParams);
cdxIter = cluster.getCDXIterator(urlkey, prefix, true, params);
cdxIter = cluster.getCDXIterator(urlkey, prefix.substring(0, prefix.length() - 2), false, params);
代码示例来源:origin: org.netpreserve.openwayback/openwayback-cdx-server
long numLines = 0;
if (cluster.isDisabled()) {
return 0;
numLines = cluster.getTotalLines();
if (numLines > 0) {
return numLines;
String[] startAndEndBlocks = cluster.getSummary().getRange(start, end);
numLines = cluster.getNumLines(startAndEndBlocks);
adjustment = cluster.getLastBlockDiff(startTokens[0],
startPart, endPart);
blocklines = cluster.getCDXIterator(new CachedStringIterator(
startAndEndBlocks[0], startAndEndBlocks[1]), start, end, 0,
1);
numLines *= cluster.getCdxLinesPerBlock();
numLines += count;
numLines += adjustment;
代码示例来源:origin: org.netpreserve.commons/webarchive-commons
String cachedUrl = locCacheGet(partId);
boolean required = (isRequired() && (i == lastIndex));
locCachePut(partId, connectedUrl);
代码示例来源:origin: iipc/webarchive-commons
lastModTime = locReaderFactory.getModTime();
loadPartLocations(locMap);
endDate = newEndDate;
locRoot = newLocRoot;
this.cdxLinesTotalCount = computeTotalLines();
this.loadLastBlockSizes(blockSizesFile);
代码示例来源:origin: iipc/openwayback
PageResult pageResult = zipnumSource.getNthPage(startEndUrl,
query.page, query.pageSize, query.showNumPages);
String zipnumClusterUri = zipnumSource.getLocRoot();
} else {
responseWriter.setMaxLines(
query.pageSize * zipnumSource.getCdxLinesPerBlock(),
zipnumClusterUri);
代码示例来源:origin: org.netpreserve.commons/commons-web
public long getLastBlockDiff(String startKey, int startPart, int endPart) {
if (startPart >= lastBlockSizes.length || endPart >= lastBlockSizes.length) {
return 0;
}
if (startKey.equals(lastBlockSizes[startPart].urltimestamp)) {
startPart++;
}
long diff = 0;
for (int i = startPart; i < endPart; i++) {
diff += lastBlockSizes[i].count;
diff -= this.getCdxLinesPerBlock();
}
return diff;
}
代码示例来源:origin: iipc/webarchive-commons
public CloseableIterator<String> getCDXIterator(String key, String start, String end, ZipNumParams params) throws IOException {
if (!dateRangeCheck(key)) {
return EMPTY_ITERATOR;
}
return super.getCDXIterator(key, start, end, params);
}
代码示例来源:origin: org.netpreserve.openwayback/openwayback-core
} catch (ResourceIndexNotAvailableException e) {
if (source instanceof ZipNumClusterSearchResultSource) {
if (((ZipNumClusterSearchResultSource)source).getCluster().isRequired()) {
throw e;
代码示例来源:origin: org.netpreserve.openwayback/openwayback-core
prefix = prefix.substring(0, space);
cdxIter = cluster.getCDXIterator(urlkey, prefix, true, oneBlockParams);
cdxIter = cluster.getCDXIterator(urlkey, prefix, true, params);
cdxIter = cluster.getCDXIterator(urlkey, prefix.substring(0, prefix.length() - 2), false, params);
代码示例来源:origin: iipc/webarchive-commons
public long computeTotalLines()
{
long numLines = 0;
try {
numLines = this.getNumLines(summary.getRange("", ""));
} catch (IOException e) {
LOGGER.warning(e.toString());
return 0;
}
long adjustment = getTotalAdjustment();
numLines -= (getNumBlocks() - 1);
numLines *= this.getCdxLinesPerBlock();
numLines += adjustment;
return numLines;
}
内容来源于网络,如有侵权,请联系作者删除!