Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public byte[] encodeData() {
}
BufferGrabbingByteArrayOutputStream stream = new BufferGrabbingByteArrayOutputStream();
baos.writeTo(stream);
this.dataBlockEncoder.endBlockEncoding(encodingCtx, out, stream.getOurBytes());
this.dataBlockEncoder.endBlockEncoding(encodingCtx, out, stream.toByteArray());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file keep the code in sync with changes proposed on #277

} catch (IOException e) {
throw new RuntimeException(String.format(
"Bug in encoding part of algorithm %s. " +
Expand All @@ -268,14 +268,15 @@ public byte[] encodeData() {
private static class BufferGrabbingByteArrayOutputStream extends ByteArrayOutputStream {
private byte[] ourBytes;

private synchronized byte[] getOurBytes() {
return ourBytes;
}

@Override
public synchronized void write(byte[] b, int off, int len) {
this.ourBytes = b;
}

@Override
public synchronized byte[] toByteArray() {
return ourBytes;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3078,7 +3078,7 @@ public List<String> listNamespaces() throws IOException {
}
}
if (cpHost != null) {
bypass = cpHost.postListNamespaces(namespaces);
cpHost.postListNamespaces(namespaces);
}
return namespaces;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,10 @@ private void applyThrottle(final Quotas.Builder quotas, final ThrottleRequest re
case READ_SIZE:
if (req.hasTimedQuota()) {
throttle.setReadSize(req.getTimedQuota());
} else {
throttle.clearReadSize();
}
} else {
throttle.clearReadSize();
}
break;
case REQUEST_CAPACITY_UNIT:
if (req.hasTimedQuota()) {
throttle.setReqCapacityUnit(req.getTimedQuota());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7959,7 +7959,9 @@ public Result append(Append mutate, long nonceGroup, long nonce) throws IOExcept
for (Map.Entry<Store, List<Cell>> entry: removedCellsForMemStore.entrySet()) {
entry.getKey().add(entry.getValue());
}
if (we != null) mvcc.complete(we);
Copy link
Contributor Author

@apurtell apurtell May 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to this file are a carrying forward of formatting changes proposed on #275 and #277. They don't address a findbugs issue, only try to keep the code as consistent as possible between branches.

if (we != null) {
mvcc.complete(we);
}
} else if (we != null) {
mvcc.completeAndWait(we);
}
Expand Down Expand Up @@ -8180,16 +8182,21 @@ private Result doIncrement(Increment increment, long nonceGroup, long nonce) thr
rowLock.release();
}
// if the wal sync was unsuccessful, remove keys from memstore
WriteEntry we = walKey != null ? walKey.getWriteEntry() : null;
if (doRollBackMemstore) {
for (Map.Entry<Store, List<Cell>> entry: forMemStore.entrySet()) {
rollbackMemstore(entry.getKey(), entry.getValue());
}
for (Map.Entry<Store, List<Cell>> entry: removedCellsForMemStore.entrySet()) {
entry.getKey().add(entry.getValue());
}
if (walKey != null) mvcc.complete(walKey.getWriteEntry());
if (we != null) {
mvcc.complete(we);
}
} else {
if (walKey != null) mvcc.completeAndWait(walKey.getWriteEntry());
if (we != null) {
mvcc.completeAndWait(we);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2796,10 +2796,14 @@ private void removeCompactedfiles(Collection<StoreFile> compactedfiles)
// Just close and return
filesToRemove.add(file);
} else {
LOG.info("Can't archive compacted file " + file.getPath()
if (r != null) {
LOG.info("Can't archive compacted file " + file.getPath()
+ " because of either isCompactedAway=" + r.isCompactedAway()
+ " or file has reference, isReferencedInReads=" + r.isReferencedInReads()
+ ", refCount=" + r.getRefCount() + ", skipping for now.");
} else {
LOG.info("Can't archive compacted file " + file.getPath() + ", skipping for now.");
}
}
} catch (Exception e) {
LOG.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
public class MajorCompactor extends Configured implements Tool {

private static final Logger LOG = LoggerFactory.getLogger(MajorCompactor.class);
protected static final Set<MajorCompactionRequest> ERRORS = Sets.newHashSet();
static final Set<MajorCompactionRequest> ERRORS = Sets.newHashSet();

protected ClusterCompactionQueues clusterCompactionQueues;
private long timestamp;
Expand Down