Skip to content

Commit

Permalink
TEZ-2849. Implement Specific Workaround for JDK-8026049 & JDK-8073093…
Browse files Browse the repository at this point in the history
… (gopalv via rbalamohan)
  • Loading branch information
rbalamohan committed Nov 4, 2015
1 parent fccb6f1 commit 34f9bda
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
TEZ-2679. Admin forms of launch env settings

ALL CHANGES:
TEZ-2849. Implement Specific Workaround for JDK-8026049 & JDK-8073093.
TEZ-2828. Fix typo in "Shuffle assigned " log statement in shuffle.orderedgrouped.Shuffle.
TEZ-2909. Tez UI: Application link in All DAGs table is disable when applicationhistory is unavailable
TEZ-808. Handle task attempts that are not making progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@Public
@Unstable
public class TezBytesComparator extends WritableComparator implements
public final class TezBytesComparator extends WritableComparator implements
ProxyComparator<BytesWritable> {

public TezBytesComparator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,13 +848,14 @@ public void copy(DataInputBuffer clone) {
}
}

private final class SortSpan implements IndexedSortable {
private final class SortSpan implements IndexedSortable {
final IntBuffer kvmeta;
final byte[] rawkvmeta;
final int kvmetabase;
final ByteBuffer kvbuffer;
final DataOutputStream out;
final RawComparator comparator;
final int imeta[] = new int[NMETA];
final int jmeta[] = new int[NMETA];
final byte[] imeta = new byte[METASIZE];

private int index = 0;
private long eq = 0;
Expand All @@ -878,8 +879,10 @@ public SortSpan(ByteBuffer source, int maxItems, int perItem, RawComparator comp
kvbuffer = reserved.slice();
reserved.flip();
reserved.limit(metasize);
kvmeta = reserved
.slice()
ByteBuffer kvmetabuffer = reserved.slice();
rawkvmeta = kvmetabuffer.array();
kvmetabase = kvmetabuffer.arrayOffset();
kvmeta = kvmetabuffer
.order(ByteOrder.nativeOrder())
.asIntBuffer();
out = new DataOutputStream(
Expand All @@ -894,7 +897,7 @@ public SpanIterator sort(IndexedSorter sorter) {
}
LOG.info(outputContext.getDestinationVertexName() + ": " + "done sorting span=" + index + ", length=" + length() + ", "
+ "time=" + (System.currentTimeMillis() - start));
return new SpanIterator(this);
return new SpanIterator((SortSpan)this);
}

int offsetFor(int i) {
Expand All @@ -905,13 +908,14 @@ public void swap(final int mi, final int mj) {
final int kvi = offsetFor(mi);
final int kvj = offsetFor(mj);

kvmeta.position(kvi); kvmeta.get(imeta);
kvmeta.position(kvj); kvmeta.get(jmeta);
kvmeta.position(kvj); kvmeta.put(imeta);
kvmeta.position(kvi); kvmeta.put(jmeta);
final int kvioff = kvmetabase + (kvi << 2);
final int kvjoff = kvmetabase + (kvj << 2);
System.arraycopy(rawkvmeta, kvioff, imeta, 0, METASIZE);
System.arraycopy(rawkvmeta, kvjoff, rawkvmeta, kvioff, METASIZE);
System.arraycopy(imeta, 0, rawkvmeta, kvjoff, METASIZE);
}

private int compareKeys(final int kvi, final int kvj) {
protected int compareKeys(final int kvi, final int kvj) {
final int istart = kvmeta.get(kvi + KEYSTART);
final int jstart = kvmeta.get(kvj + KEYSTART);
final int ilen = kvmeta.get(kvi + VALSTART) - istart;
Expand Down

0 comments on commit 34f9bda

Please sign in to comment.