@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { mlSplit = (MarkLogicInputSplit)split; count = 0; context.getCounter(MarkLogicCounter.ESTIMATED_INPUT_RECORDS) .increment(mlSplit.getLength()); // check hostnames hostNames = mlSplit.getLocations(); if (hostNames == null || hostNames.length < 1) { throw new IllegalStateException("Empty split locations."); } if (LOG.isDebugEnabled()) { LOG.debug("split location: " + hostNames[0]); } replicas = mlSplit.getReplicas(); curForest = -1; if (replicas != null) { for (int i = 0; i < replicas.size(); i++) { if (replicas.get(i).getHostName().equals(hostNames[0])) { curForest = i; break; } } } retry = 0; sleepTime = 500; init(); }
length = mlSplit.getLength() * recToFragRatio; long start = mlSplit.getStart() + 1 + count; long end = mlSplit.isLastSplit() ? Long.MAX_VALUE : start + mlSplit.getLength() - count - 1; String curHostName = ""; if (curForest == -1) { curForestName = mlSplit.getForestId().toString(); curHostName = hostNames[0]; } else {
MarkLogicInputSplit split = new MarkLogicInputSplit(0, 0, fsplit.forestId, fsplit.hostName, fsplit.replicas); split.setLastSplit(true); splits.add(split); if (LOG.isDebugEnabled()) { MarkLogicInputSplit split; if (remainingCount < splitSize) { split = new MarkLogicInputSplit(start, remainingCount, fsplit.forestId, fsplit.hostName, fsplit.replicas); split.setLastSplit(true); remainingCount = 0L; } else { split = new MarkLogicInputSplit(start, splitSize, fsplit.forestId, fsplit.hostName, fsplit.replicas); remainingCount -= splitSize;
if (copyProperties && mlSplit.getStart() == 0) { retry = 0; sleepTime = 500;
length = mlSplit.getLength() * recToFragRatio; long start = mlSplit.getStart() + 1 + count; long end = mlSplit.isLastSplit() ? Long.MAX_VALUE : start + mlSplit.getLength() - count - 1; if (!advancedMode) { StringBuilder buf = new StringBuilder(); mlSplit.isLastSplit() ? Long.MAX_VALUE : (long)length); String curHostName = ""; if (curForest == -1) { curForestName = mlSplit.getForestId().toString(); curHostName = hostNames[0]; } else { LOG.debug("split start position: " + start); query.setCount(mlSplit.isLastSplit() ? Long.MAX_VALUE : mlSplit.getLength());
@Override public void initialize(InputSplit inSplit, TaskAttemptContext context) throws IOException, InterruptedException { mlSplit = (MarkLogicInputSplit) inSplit; count = 0; nakedCount = 0; context.getCounter(MarkLogicCounter.ESTIMATED_INPUT_RECORDS) .increment(mlSplit.getLength()); // construct the server URI hostNames = mlSplit.getLocations(); if (hostNames == null || hostNames.length < 1) { throw new IllegalStateException("Empty split locations."); } if (LOG.isDebugEnabled()) { LOG.debug("split location: " + hostNames[0]); } replicas = mlSplit.getReplicas(); curForest = -1; if (replicas != null) { for (int i = 0; i < replicas.size(); i++) { if (replicas.get(i).getHostName().equals(hostNames[0])) { curForest = i; break; } } } retry = 0; sleepTime = 500; init(); }