Search in sources :

Example 1 with StreamLogFiles

use of org.corfudb.infrastructure.log.StreamLogFiles in project CorfuDB by CorfuDB.

the class logReaderTest method setUp.

@Before
public void setUp() {
    File fDir = new File(LOG_PATH);
    fDir.mkdirs();
    StreamLogFiles logfile = new StreamLogFiles(getContext(), false);
    ByteBuf buf = ByteBufAllocator.DEFAULT.buffer();
    Serializers.CORFU.serialize("Hello World".getBytes(), buf);
    LogData data = new LogData(DataType.DATA, buf);
    logfile.append(0, data);
    buf.clear();
    Serializers.CORFU.serialize("Happy Days".getBytes(), buf);
    data = new LogData(DataType.DATA, buf);
    logfile.append(1, data);
    buf.clear();
    Serializers.CORFU.serialize("Corfu test".getBytes(), buf);
    data = new LogData(DataType.DATA, buf);
    logfile.append(2, data);
    logfile.close();
}
Also used : LogData(org.corfudb.protocols.wireprotocol.LogData) StreamLogFiles(org.corfudb.infrastructure.log.StreamLogFiles) ByteBuf(io.netty.buffer.ByteBuf) File(java.io.File) Before(org.junit.Before)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 File (java.io.File)1 StreamLogFiles (org.corfudb.infrastructure.log.StreamLogFiles)1 LogData (org.corfudb.protocols.wireprotocol.LogData)1 Before (org.junit.Before)1