Skip to content

Commit

Permalink
fix operator initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobin Baker committed May 11, 2017
1 parent 896185d commit 394e92f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/edu/washington/escience/myria/operator/DupElim.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class DupElim extends UnaryOperator {
/** Map of first 64-bit words to colliding second 64-bit words. */
private transient LongObjectHashMap<LongArrayList> collidingFinalHashCodes;
/** Cached byte buffer to avoid allocating a new buffer for each byte copy. */
private transient ByteBuffer byteCopyBuffer = ByteBuffer.allocate(Long.BYTES);
private transient ByteBuffer byteCopyBuffer;

/**
* @param child the child
Expand All @@ -49,7 +49,11 @@ public DupElim(final Operator child) {
}

@Override
protected void cleanup() throws DbException {}
protected void cleanup() throws DbException {
initialToFinalhashCodes = null;
collidingFinalHashCodes = null;
byteCopyBuffer = null;
}

/**
* Do duplicate elimination for the tb.
Expand Down Expand Up @@ -139,5 +143,6 @@ public Schema generateSchema() {
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException {
initialToFinalhashCodes = new LongLongHashMap();
collidingFinalHashCodes = new LongObjectHashMap<LongArrayList>();
byteCopyBuffer = ByteBuffer.allocate(Long.BYTES);
}
}

0 comments on commit 394e92f

Please sign in to comment.