int DumpTrackerDDLRawStream(
- const char* buffer, unsigned long bufferSize,
- bool continueParse
+ char* buffer, unsigned long bufferSize,
+ bool continueParse, bool tryrecover
)
{
// Dumps a tracker DDL raw stream data.
- const AliRawDataHeader* header =
- reinterpret_cast<const AliRawDataHeader*>(buffer);
+ AliRawDataHeader* header = reinterpret_cast<AliRawDataHeader*>(buffer);
int result = DumpRawDataHeader(buffer, bufferSize, header, continueParse);
if (result != EXIT_SUCCESS) return result;
AliMUONTrackerDDLDecoder<AliTrackerDecoderHandler> decoder;
decoder.ExitOnError(not continueParse);
decoder.SendDataOnParityError(true);
- decoder.TryRecover(false);
+ decoder.TryRecover(tryrecover);
decoder.AutoDetectTrailer(true);
decoder.CheckForTrailer(true);
- const char* payload = buffer + sizeof(AliRawDataHeader);
+ char* payload = buffer + sizeof(AliRawDataHeader);
UInt_t payloadSize = bufferSize - sizeof(AliRawDataHeader);
if (decoder.Decode(payload, payloadSize))
{
int DumpTriggerDDLRawStream(
const char* buffer, unsigned long bufferSize,
- bool continueParse
+ bool continueParse, bool tryrecover
)
{
// Dumps a trigger DDL raw stream data.
AliMUONTriggerDDLDecoder<AliTriggerDecoderHandler> decoder;
decoder.ExitOnError(not continueParse);
- decoder.TryRecover(false);
+ decoder.TryRecover(tryrecover);
decoder.AutoDetectScalars(false);
const char* payload = buffer + sizeof(AliRawDataHeader);
UInt_t payloadSize = bufferSize - sizeof(AliRawDataHeader);
* [in] \param bufferSize The size of the buffer in bytes.
* [in] \param continueParse If specified then the we try to continue parsing the
* buffer as much as possible.
+ * [in] \param tryrecover Indicates if the DDL decoders should have special
+ * recovery logic enabled.
* [in/out] \param type Initialy this should indicate the type of the data block
* or kUnknownDataBlock if not known. On exit it will be filled with
* the type of the data block as discovered by this routine if type
* on success.
*/
int ParseBuffer(
- const char* buffer, unsigned long bufferSize,
- bool continueParse, int& type
+ char* buffer, unsigned long bufferSize,
+ bool continueParse, bool tryrecover, int& type
)
{
assert( buffer != NULL );
switch (type)
{
case kTrackerDDLRawData:
- subResult = DumpTrackerDDLRawStream(buffer, bufferSize, continueParse);
+ subResult = DumpTrackerDDLRawStream(buffer, bufferSize, continueParse, tryrecover);
if (subResult != EXIT_SUCCESS) result = subResult;
break;
case kTriggerDDLRawData:
- subResult = DumpTriggerDDLRawStream(buffer, bufferSize, continueParse);
+ subResult = DumpTriggerDDLRawStream(buffer, bufferSize, continueParse, tryrecover);
if (subResult != EXIT_SUCCESS) result = subResult;
break;
case kTriggerRecordsDataBlock:
os << " -continue | -c" << endl;
os << " If specified, the program will try to continue parsing the data block" << endl;
os << " as much as possible rather than stopping at the first error." << endl;
+ os << " -recover | -e" << endl;
+ os << " If specified, special DDL decoder recovery logic is enabled to handle" << endl;
+ os << " corrupt DDL data." << endl;
os << " -type | -t <typename>" << endl;
os << " Forces the contents of the subsequent files specified on the command" << endl;
os << " line to be interpreted as a specific type of data block." << endl;
* and added to 'filenames'.
* @param continueParse Set to true if the user requested to continue to parse
* after errors.
+ * @param tryrecover Set to true if the user wants DDL decoder recovery logic enabled.
* @param checkData Set to true if data integrity checking was requested.
* @param maxLogging Set to true if maximal logging was requested.
* @return A status flag suitable for returning from main(), containing either
const char** dataspecs,
int& numOfFiles,
bool& continueParse,
+ bool& tryrecover,
bool& checkData,
bool& maxLogging
)
{
numOfFiles = 0;
continueParse = false;
+ tryrecover = false;
maxLogging = false;
checkData = false;
int currentType = kUnknownDataBlock;
{
continueParse = true;
}
+ else if (strcmp(argv[i], "-recover") == 0 or strcmp(argv[i], "-e") == 0)
+ {
+ tryrecover = true;
+ }
else if (strcmp(argv[i], "-type") == 0 or strcmp(argv[i], "-t") == 0)
{
if (++i >= argc)
int numOfFiles = 0;
bool continueParse = false;
+ bool tryrecover = false;
bool checkData = false;
bool maxLogging = false;
int returnCode = EXIT_SUCCESS;
returnCode = ParseCommandLine(
argc, argv, filename, filetype, dataspec, numOfFiles,
- continueParse, checkData, maxLogging
+ continueParse, tryrecover, checkData, maxLogging
);
if (returnCode == EXIT_SUCCESS)
cout << "########## Start of dump for file: "
<< filename[i] << " ##########" << endl;
}
- int result = ParseBuffer(buffer, bufferSize, continueParse, filetype[i]);
+ int result = ParseBuffer(buffer, bufferSize, continueParse, tryrecover, filetype[i]);
if (buffer != NULL) delete [] buffer;
if (result != EXIT_SUCCESS)
{