@Deprecated public class StreamViewSMRAdapter extends Object implements ISMRStream
This is a relatively thin wrapper. For example, an underlying stream returns from current() a LogData entry. StreamViewSMRAdapter verifies that the entry contains data (otherwise, return null), and that the payload is of type ISMRConsumable (otherwise, again return null). Since the underlying log supports multi-stream entries, it collects and returns the SMREntries related to the current stream.
Created by mwei on 3/10/17.
Constructor and Description |
---|
StreamViewSMRAdapter(CorfuRuntime runtime,
IStreamView streamView)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
long |
append(SMREntry entry,
Function<TokenResponse,Boolean> acquisitionCallback,
Function<TokenResponse,Boolean> deacquisitionCallback)
Deprecated.
Append a SMREntry to the stream, returning the global address
it was written at.
|
List<SMREntry> |
current()
Deprecated.
Returns the list of SMREntries positioned at the current global log.
|
void |
gc(long trimMark)
Deprecated.
|
UUID |
getID()
Deprecated.
Get the UUID for this stream (optional operation).
|
long |
pos()
Deprecated.
|
List<SMREntry> |
previous()
Deprecated.
Returns the list of SMREntries positioned at the previous log position of this stream.
|
List<SMREntry> |
remainingUpTo(long maxGlobal)
Deprecated.
Returns all entries remaining upto the specified the global address specified.
|
void |
reset()
Deprecated.
|
void |
seek(long globalAddress)
Deprecated.
|
Stream<SMREntry> |
stream()
Deprecated.
|
Stream<SMREntry> |
streamUpTo(long maxGlobal)
Deprecated.
|
public StreamViewSMRAdapter(CorfuRuntime runtime, IStreamView streamView)
public void gc(long trimMark)
gc
in interface ISMRStream
public List<SMREntry> remainingUpTo(long maxGlobal)
remainingUpTo
in interface ISMRStream
maxGlobal
- Max Global up to which SMR Entries are required.public List<SMREntry> current()
current
in interface ISMRStream
public List<SMREntry> previous()
previous
in interface ISMRStream
public long pos()
pos
in interface ISMRStream
public void reset()
reset
in interface ISMRStream
public void seek(long globalAddress)
seek
in interface ISMRStream
public Stream<SMREntry> stream()
stream
in interface ISMRStream
public Stream<SMREntry> streamUpTo(long maxGlobal)
streamUpTo
in interface ISMRStream
public long append(SMREntry entry, Function<TokenResponse,Boolean> acquisitionCallback, Function<TokenResponse,Boolean> deacquisitionCallback)
Optionally, provide a method to be called when an address is acquired, and also a method to be called when an address is released (due to an unsuccessful append).
append
in interface ISMRStream
entry
- The SMR entry to append.acquisitionCallback
- A function to call when an address is
acquired.
It should return true to continue with the
append.deacquisitionCallback
- A function to call when an address is
released. It should return true to retry
writing.public UUID getID()
getID
in interface ISMRStream
Copyright © 2019 CorfuDB. All rights reserved.