Search in sources :

Example 1 with BufferInfoResponse

use of com.linkedin.databus.core.BufferInfoResponse in project databus by linkedin.

the class BufferInfoRequestProcessor method processInboundRequest.

private void processInboundRequest(DatabusRequest request, PhysicalPartition pPart) throws IOException, DatabusException {
    DbusEventBuffer evb = _eventBufferMult.getOneBuffer(pPart);
    if (null == evb) {
        LOG.error("BufferInfoRequest : Buffer not available for physical partition :" + pPart);
        throw new BufferNotFoundException("Buffer not available for partition :" + pPart);
    }
    BufferInfoResponse response = new BufferInfoResponse();
    response.setMinScn(evb.getMinScn());
    response.setMaxScn(evb.lastWrittenScn());
    response.setTimestampFirstEvent(evb.getTimestampOfFirstEvent());
    response.setTimestampLatestEvent(evb.getTimestampOfLatestDataEvent());
    writeJsonObjectToResponse(response, request);
}
Also used : BufferNotFoundException(com.linkedin.databus2.core.BufferNotFoundException) DbusEventBuffer(com.linkedin.databus.core.DbusEventBuffer) BufferInfoResponse(com.linkedin.databus.core.BufferInfoResponse)

Aggregations

BufferInfoResponse (com.linkedin.databus.core.BufferInfoResponse)1 DbusEventBuffer (com.linkedin.databus.core.DbusEventBuffer)1 BufferNotFoundException (com.linkedin.databus2.core.BufferNotFoundException)1