Skip to content

Commit

Permalink
Yet more #400 prep work
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 12, 2023
1 parent 323373d commit 365fb69
Showing 1 changed file with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import org.apache.avro.io.*;

import com.fasterxml.jackson.core.JsonProcessingException;

/**
* Simple helper class that contains extracted functionality for
* simple encoder/decoder recycling.
Expand All @@ -30,11 +28,11 @@ private ApacheCodecRecycler() { }
*/

public static BinaryDecoder acquireDecoder() {
return _recycler().claimDecoder();
return _recycler().decoderRef.getAndSet(null);
}

public static BinaryEncoder acquireEncoder() {
return _recycler().claimEncoder();
return _recycler().encoderRef.getAndSet(null);
}

public static void release(BinaryDecoder dec) {
Expand All @@ -61,27 +59,4 @@ private static ApacheCodecRecycler _recycler() {
}
return r;
}

private BinaryDecoder claimDecoder() {
return decoderRef.getAndSet(null);
}

private BinaryEncoder claimEncoder() {
return encoderRef.getAndSet(null);
}

/*
/**********************************************************
/* Helper class
/**********************************************************
*/

public static class BadSchemaException extends JsonProcessingException
{
private static final long serialVersionUID = 1L;

public BadSchemaException(String msg, Throwable src) {
super(msg, src);
}
}
}

0 comments on commit 365fb69

Please sign in to comment.