Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I8d761b5cd1e0d5a44c1db5cbd62c74167ff51a64 Reviewed-on: http://review.couchbase.org/7898 Reviewed-by: Matt Ingenthron <matt@couchbase.com> Tested-by: Matt Ingenthron <matt@couchbase.com>
- Loading branch information
Showing
6 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/net/spy/memcached/protocol/binary/TapDumpOperationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package net.spy.memcached.protocol.binary; | ||
|
||
import java.util.UUID; | ||
|
||
import net.spy.memcached.ops.OperationCallback; | ||
import net.spy.memcached.ops.OperationState; | ||
import net.spy.memcached.ops.TapOperation; | ||
import net.spy.memcached.tapmessage.RequestMessage; | ||
import net.spy.memcached.tapmessage.TapFlag; | ||
import net.spy.memcached.tapmessage.TapMagic; | ||
import net.spy.memcached.tapmessage.TapOpcode; | ||
|
||
public class TapDumpOperationImpl extends TapOperationImpl implements TapOperation { | ||
private final String id; | ||
|
||
TapDumpOperationImpl(String id, OperationCallback cb) { | ||
super(cb); | ||
this.id = id; | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
RequestMessage message = new RequestMessage(); | ||
message.setMagic(TapMagic.PROTOCOL_BINARY_REQ); | ||
message.setOpcode(TapOpcode.REQUEST); | ||
message.setFlags(TapFlag.DUMP); | ||
message.setFlags(TapFlag.SUPPORT_ACK); | ||
if (id != null) { | ||
message.setName(id); | ||
} else { | ||
message.setName(UUID.randomUUID().toString()); | ||
} | ||
|
||
setBuffer(message.getBytes()); | ||
} | ||
|
||
@Override | ||
public void streamClosed(OperationState state) { | ||
transitionState(state); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters