String fileStr = request.getRequiredStringParam(FILE_PATH_PARAM);
String startWinStr = request.getParams().getProperty(START_WINDOW_PARAM, "false");
String physicalParitionParameter = request.getParams().getProperty(PHYSICAL_PARTITION_ID_PARAM);
LOG.info(PHYSICAL_PARTITION_ID_PARAM + "=" + physicalParitionParameter);
PhysicalPartition pPartition = PhysicalSourceStaticConfig.getDefaultPhysicalPartition();
if(physicalParitionParameter != null) {
// physical partition parameter format is PPName_PPId
pPartition = PhysicalPartition.parsePhysicalPartitionString(physicalParitionParameter, "_");
}
boolean startWin = Boolean.valueOf(startWinStr);
BufferedReader in = new BufferedReader(new FileReader(fileStr));
try
{
//PhysicalPartition pPartition = new PhysicalPartition(physicalPartitionId);
// TODO this should actually use DbusEventBufferAppendable (DDSDBUS-78)
DbusEventBuffer buf = (DbusEventBuffer)_eventBuffer.getDbusEventBufferAppendable(pPartition);
if(buf == null)
throw new RequestProcessingException("cannot find buffer for ph. partion " + pPartition);
if ((buf.getMinScn() < 0) && (buf.getPrevScn() < 0)) buf.start(0);
try
{
DbusEventsStatisticsCollector statsCollector = _relay.getInBoundStatsCollectors().getStatsCollector(pPartition.toSimpleString());
int eventsAppended = 0;
if (!((eventsAppended = DbusEventSerializable.appendToEventBuffer(in, buf, statsCollector, startWin))>0))
{
throw new RequestProcessingException("event loading failed");