Public Member Functions | Private Member Functions | Private Attributes

df_FRIDistiller Class Reference
[IVD Data format.]

#include <df.h>

Inheritance diagram for df_FRIDistiller:
Inheritance graph
[legend]
Collaboration diagram for df_FRIDistiller:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 df_FRIDistiller (df_BlockProxy *a_reader_p, cmn_UUID_t a_medVolID, cmn_UUID_t a_poolID, cmn_UUID_t a_partID, df_Writer &a_output)
virtual ~df_FRIDistiller ()
void CompleteStream (bool a_eod)
void WriteCurrentSplit ()

Private Member Functions

void WriteFRIStart ()
void WriteFRIEnd (UInt32_t a_status)
void WriteSplitInfo (const df_RecCmn_t *a_fileEnd_p)
void CopyRecord (const df_RecCmn_t *a_recCmn_p)
virtual void ProcBlock (const UInt8_t *a_dataBlock)
virtual void ProcRawBlock (const UInt8_t *a_dataBlock)
virtual void ProcRecFileHdr (const df_RecCmn_t *a_recCmn_p)
virtual void ProcRecFileEnd (const df_RecCmn_t *a_recCmn_p)
virtual void ProcRecBSStart (const df_RecCmn_t *a_recCmn_p)
virtual void ProcRecEmbData (const df_RecCmn_t *a_recCmn_p)
virtual void ProcRecRawData (const UInt8_t *a_block_p)
virtual void ProcRecBSEnd (const df_RecCmn_t *a_recCmn_p)
virtual void ProcEndOfInput ()
 method ProcEndOfInput() must be called at the end of input when block per block parsing is used (migration, FRI check before wirtten to media.
virtual bool HandleDFError (const ivd_DFError &ie)

Private Attributes

 log_CLASSID_m
 Macro to add class name member s_className.
df_Writerm_output
const cmn_UUID_t m_medVolID
const cmn_UUID_t m_poolID
const cmn_UUID_t m_partID
UInt32_t m_firstBlockID
df_SplitInfo m_curSplit
 Holds information about the split info that is being processed.
UInt64_t m_curStreamSize
 Fast fix 2106.
bool m_splitStartRecorded
 Was split offset recorded in m_curSplit?
UInt64_t m_curSplitSize
 Size of the current split.
UInt32_t m_friRecNum
 Counter for FRI records.

Detailed Description

Definition at line 1616 of file df.h.


Constructor & Destructor Documentation

df_FRIDistiller::df_FRIDistiller ( df_BlockProxy a_reader_p,
cmn_UUID_t  a_medVolID,
cmn_UUID_t  a_poolID,
cmn_UUID_t  a_partID,
df_Writer a_output 
)

Definition at line 53 of file df_fridistiller.cpp.

References df_SplitInfo::Clear(), log_FUNC_m, and m_curSplit.

    :
      df_RecReader(a_reader_p),
      m_output(a_output),
      m_medVolID(a_medVolID),
      m_poolID(a_poolID),
      m_partID(a_partID),
      m_firstBlockID(0),
      m_curStreamSize(0),
      m_splitStartRecorded(false),
      m_curSplitSize(0),
      m_friRecNum(0) {

    log_FUNC_m(df_FRIDistiller);

    m_curSplit.Clear();
}

Here is the call graph for this function:

df_FRIDistiller::~df_FRIDistiller (  )  [virtual]

Definition at line 80 of file df_fridistiller.cpp.

References df_FRIS_COMPLETE, log_FUNC_m, and WriteFRIEnd().

Here is the call graph for this function:


Member Function Documentation

void df_FRIDistiller::CompleteStream ( bool  a_eod  ) 

Definition at line 87 of file df_fridistiller.cpp.

References alloca(), CopyRecord(), dbg_LOW, df_ALIGN_m, df_FS_ERROR, df_ST_META, df_SplitInfo::Dump(), df_SplitInfo::fileID, df_RecReader::GetBlkSize(), log_DBG_m, log_FUNC_m, m_curSplit, m_curSplitSize, df_RecReader::m_curStreamName, m_curStreamSize, df_RecReader::m_curStreamType, m_splitStartRecorded, df_SplitInfo::migrationID, NULL, df_SplitInfo::splitOffset, df_SplitInfo::splitSize, df_Packer::WriteRecBSEndRaw(), df_Packer::WriteRecFileEndRaw(), and WriteSplitInfo().

Referenced by HandleDFError(), ProcBlock(), ProcEndOfInput(), and ProcRecRawData().

                                               {
    log_FUNC_m(CompleteStream);

    if (m_splitStartRecorded) {
        m_curSplit.splitSize = m_curSplitSize;
        if (a_eod) {
            log_DBG_m(dbg_LOW,
                "Flushing split for: " << m_curSplit.fileID <<
                " offset: " << m_curSplit.splitOffset <<
                " size:" << m_curSplit.splitSize);
        }
        else {
            log_DBG_m(dbg_LOW, "Complete opened stream. " << m_curSplit.Dump());
        }

        if (!a_eod) {
        // This is not a split. Write BSE with error status.
            if ( ((m_curStreamType == df_ST_META) && (m_curStreamSize <= GetBlkSize()))
            || (m_curStreamType == df_ST_ALTDATA)) {

                UInt32_t recSize = df_ALIGN_m(sizeof(df_RecCmn_t)
                                + sizeof(df_RecByteStreamEnd_t)
                                + m_curStreamName.length()
                                + 1);

                UInt8_t *buff = reinterpret_cast<UInt8_t*>(alloca(recSize));

                df_Packer::WriteRecBSEndRaw(
                    m_curSplit.fileID,
                    df_FS_ERROR,
                    m_curStreamType,
                    m_curStreamSize,
                    m_curSplitSize,
                    m_curStreamName,
                    0,
                    buff);

                CopyRecord(reinterpret_cast<df_RecCmn_t*>(buff));
            }
        }
        m_curStreamType = 0;

        if (a_eod) {
            // file end is not written at EOD (== split).
            WriteSplitInfo(NULL);
        }
        else {
            // Detected aborted migration (not a split)
            // Append file-end with error status
            UInt32_t recSize = df_ALIGN_m(sizeof(df_RecCmn_t)
                             + sizeof(df_RecFileEnd_t));
            UInt8_t *buff = reinterpret_cast<UInt8_t*>(alloca(recSize));

            df_Packer::WriteRecFileEndRaw(m_curSplit.fileID,
                                          m_curSplit.migrationID,
                                          df_FS_ERROR,
                                          0,
                                          buff,
                                          0);

            WriteSplitInfo(reinterpret_cast<df_RecCmn_t*>(buff));
        }
    }
    else {
        log_DBG_m(dbg_LOW, "There is no split to write. Exit.");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void df_FRIDistiller::CopyRecord ( const df_RecCmn_t a_recCmn_p  )  [private]

Definition at line 256 of file df_fridistiller.cpp.

References df_BlockProxyWriter::Allocate(), hton(), m_friRecNum, m_output, df_BlockProxyWriter::Move(), ntoh(), NULL, df_RecCmn_t::seqNum, and df_RecCmn_t::size.

Referenced by CompleteStream(), ProcRecBSEnd(), ProcRecBSStart(), ProcRecEmbData(), ProcRecFileHdr(), and WriteSplitInfo().

                                                              {
    // Copy record to the Writer
    UInt32_t recSize = ntoh(a_recCmn_p->size);
    UInt8_t* target = m_output.Allocate(recSize);
    if (target == NULL) {
        return;
    }

    memcpy(target, a_recCmn_p, recSize);

    df_RecCmn_t *outRec_p = reinterpret_cast<df_RecCmn_t*>(target);
    outRec_p->seqNum = hton(++m_friRecNum);

    m_output.Move(recSize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool df_FRIDistiller::HandleDFError ( const ivd_DFError ie  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 517 of file df_fridistiller.cpp.

References CompleteStream(), df_RecReader::GetBlockID(), df_RecReader::GetBlockNum(), log_FUNC_m, log_WRN_m, m_curSplitSize, m_curStreamSize, m_medVolID, m_splitStartRecorded, df_RecReader::Reset(), and df_RecReader::SetFindMode().

                                                         {
    log_FUNC_m(HandleDFError);
    // An aborted migration is followed by new migration.
    // Data format is not valid in that case for aborted file.
    //
    // If exception has occured because of new migration on the medium then:
    //     flush current split info
    //     reset record reader (parse block from begining)
    //     return true to continue parsing
    // else
    //     return false

    CompleteStream(false);

    if (GetBlockNum() == 1) {
        // Beginning of new migration detected.
        // Parsing will continue from this block on
        Reset(false); // Reset only record reader.
    }
    else {
        // Go to find mode until next block with magic cookie and beginning of
        // file is found.
        log_WRN_m(
            "Recreate FRI (" << m_medVolID << "): " <<
            "Data format error on position " << GetBlockID() << ". "
            "Locating next useful block." );
        // Reset members
        m_curStreamSize = 0;
        m_splitStartRecorded = false;
        m_curSplitSize = 0;
        Reset();
        SetFindMode();
    }
    return true;
}

Here is the call graph for this function:

void df_FRIDistiller::ProcBlock ( const UInt8_t a_dataBlock  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 275 of file df_fridistiller.cpp.

References CompleteStream(), dbg_LOW, df_RecReader::GetBlockNum(), log_DBG_m, log_FUNC_m, and m_splitStartRecorded.

                                                         {

    // On the beginning of the new migration on the tape
    // any non-terminated file from the previous migration must be flushed
    if (GetBlockNum() == 1) {
        log_FUNC_m(ProcBlock);
        if (m_splitStartRecorded) {
            log_DBG_m(dbg_LOW, "Beginning of new migration. Flush current file.");
            CompleteStream(false);
        }
    }
}

Here is the call graph for this function:

void df_FRIDistiller::ProcEndOfInput (  )  [private, virtual]

method ProcEndOfInput() must be called at the end of input when block per block parsing is used (migration, FRI check before wirtten to media.

).

Reimplemented from df_RecReader.

Definition at line 554 of file df_fridistiller.cpp.

References CompleteStream(), and log_FUNC_m.

                                    {
    log_FUNC_m(ProcEndOfInput);
    CompleteStream(true); // complete stream at EOD
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRawBlock ( const UInt8_t a_dataBlock  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 291 of file df_fridistiller.cpp.

                                                            {
}

void df_FRIDistiller::ProcRecBSEnd ( const df_RecCmn_t a_recCmn_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 481 of file df_fridistiller.cpp.

References df_RecByteStreamEnd_t::allStreamSize, CopyRecord(), df_SplitInfo::dataType, dbg_DETAIL, df_SS_COMPLETE, df_ST_DATA, df_ST_META, df_SplitInfo::fileID, df_RecReader::GetBlkSize(), df_RecByteStreamEnd_t::idFile, log_DBG_m, log_FUNC_m, log_WRN_m, m_curSplit, m_curSplitSize, m_curStreamSize, df_RecReader::m_curStreamType, ntoh(), df_SplitInfo::splitOffset, df_SplitInfo::splitSize, and df_RecByteStreamEnd_t::status.

                                                                {
    const df_RecByteStreamEnd_t *bse_p = df_GetSpecificRec<df_RecByteStreamEnd_t>(a_recCmn_p);

    if (m_curSplitSize != (ntoh(bse_p->allStreamSize) - m_curSplit.splitOffset)) {
        log_FUNC_m(ProcRecBSEnd);
        log_WRN_m(
            "File ID: " << ntoh(bse_p->idFile) <<
            "Split size does not correspond with " <<
            "all stream size and its offset: " <<
            m_curSplitSize << " != " <<
            (ntoh(bse_p->allStreamSize) - m_curSplit.splitOffset) );
    }

    m_curSplit.splitSize = m_curSplitSize;

    if (m_curStreamType != df_ST_DATA) {
        if ((  m_curStreamType != df_ST_META   // not meta data
            || m_curStreamSize <= GetBlkSize()) ) {// or meta data less than block size
            CopyRecord(a_recCmn_p);
        }
    }
    // remove stream type if stream data is not complete.
    if (ntoh(bse_p->status) != df_SS_COMPLETE) {
        log_FUNC_m(ProcRecBSEnd);
        m_curSplit.dataType &= ~m_curStreamType;
        log_DBG_m(dbg_DETAIL,
            "Stream is not complete. FileID = " << m_curSplit.fileID <<
            " remove byte stream type = " << m_curStreamType <<
            "  data Type = " << m_curSplit.dataType);
    }

    m_curStreamSize = 0;
    m_curStreamType = 0;
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRecBSStart ( const df_RecCmn_t a_recCmn_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 391 of file df_fridistiller.cpp.

References df_RecByteStreamStart_t::allStreamSize, df_RecByteStreamStart_t::chunkOffset, df_SplitInfo::chunkOffset, CopyRecord(), df_SplitInfo::dataType, dbg_NORM, df_RF_CONTINUED, df_ST_DATA, df_ST_META, df_RecCmn_t::flags, df_RecReader::GetBlkSize(), df_RecByteStreamStart_t::idFile, log_DBG_m, log_FUNC_m, log_WRN_m, m_curSplit, m_curSplitSize, df_RecReader::m_curStreamName, m_curStreamSize, df_RecReader::m_curStreamType, ntoh(), df_SplitInfo::splitOffset, and df_RecByteStreamStart_t::streamSize.

                                                                  {

    log_FUNC_m(ProcRecBSStart);

    const df_RecByteStreamStart_t *bss_p = df_GetSpecificRec<df_RecByteStreamStart_t>(a_recCmn_p);

    m_curSplit.chunkOffset  = ntoh(bss_p->chunkOffset);

    if (ntoh(a_recCmn_p->flags) & df_RF_CONTINUED) {
        // Split in the FSC terms means split of all streams
        // in the generation.
        m_curSplit.splitOffset  = ntoh(bss_p->allStreamSize);
        m_curSplitSize          = 0;

        log_DBG_m(dbg_NORM,
            "Continued split: offset: " << m_curSplit.splitOffset);
    };

    m_curSplit.dataType |= m_curStreamType;
    m_curStreamSize = ntoh(bss_p->streamSize);

    log_DBG_m(dbg_NORM,
        "ByteStreamStart: " << std::hex << "0x" << m_curStreamType << std::dec <<
        " name: " << m_curStreamName);

    if (   m_curStreamType == df_ST_DATA) {
        return;
    }

    if (   m_curStreamType == df_ST_META
        && m_curStreamSize > GetBlkSize() ) {
        UInt64_t fileID = ntoh(bss_p->idFile);
        log_WRN_m(
            "Large meta-data stream skipped from FRI and FSC. " <<
            "File ID: " << fileID << ", stream: " << m_curStreamName);
        return;
    }

    CopyRecord(a_recCmn_p);
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRecEmbData ( const df_RecCmn_t a_recCmn_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 435 of file df_fridistiller.cpp.

References CopyRecord(), df_RecEmbeddedData_t::data, df_ST_META, df_RecReader::GetBlkSize(), m_curSplitSize, m_curStreamSize, df_RecReader::m_curStreamType, ntoh(), and ivd_VarData_t::size.

                                                                  {
    const df_RecEmbeddedData_t *emd_p = df_GetSpecificRec<df_RecEmbeddedData_t>(a_recCmn_p);

    m_curSplitSize += ntoh(emd_p->data.size);

    if (   m_curStreamType == df_ST_META
        && m_curStreamSize <= GetBlkSize() ) {
        CopyRecord(a_recCmn_p);
    }
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRecFileEnd ( const df_RecCmn_t a_recCmn_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 361 of file df_fridistiller.cpp.

References dbg_NORM, df_SplitInfo::fileID, df_RecFileEnd_t::idFile, ie_DATA_CORRUPTION, df_SplitInfo::lastSplit, log_DBG_m, log_FUNC_m, m_curSplit, ntoh(), df_RecFileEnd_t::status, and WriteSplitInfo().

                                                                  {
    log_FUNC_m(ProcRecFileEnd);

    const df_RecFileEnd_t *fe_p = df_GetSpecificRec<df_RecFileEnd_t>(a_recCmn_p);

    // TODO: Overchecking? To be put in the base class?
    if (m_curSplit.fileID != ntoh(fe_p->idFile)) {
        ostringstream sstr;
        sstr
            <<"Incorrect File ID on FileEnd. "
            << "Expected (" << m_curSplit.fileID << ") "
            << "Found (" << ntoh(fe_p->idFile) << ").";

        throw ivd_InternalError(ie_DATA_CORRUPTION, sstr.str());
    };

    // If the file end is read, then this is the last split
    // for this generation of the file.
    m_curSplit.lastSplit = true;
    UInt32_t status = ntoh(fe_p->status);

    log_DBG_m(dbg_NORM,
        "FileEnd: " << m_curSplit.fileID << " status: " << status);

    WriteSplitInfo(a_recCmn_p);
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRecFileHdr ( const df_RecCmn_t a_recCmn_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 297 of file df_fridistiller.cpp.

References df_SplitInfo::blockOffset, df_SplitInfo::chunkOffset, df_RecFile_t::chunkSize, df_SplitInfo::chunkSize, cmn_Num2Str(), CopyRecord(), df_SplitInfo::dataType, dbg_NORM, df_RF_CONTINUED, df_SplitInfo::fileID, df_SplitInfo::fileName, df_SplitInfo::fileSize, df_SplitInfo::fileType, df_RecCmn_t::flags, df_RecReader::GetBlockID(), df_RecCmn_t::GetVarDataNet(), df_RecFile_t::idFile, df_RecFile_t::idMig, df_RecFile_t::idParent, df_RecFile_t::idParentOld, ie_FATAL_ERROR, df_SplitInfo::lastSplit, log_DBG_m, log_FUNC_m, m_curSplit, m_friRecNum, m_splitStartRecorded, df_SplitInfo::mediaKey, df_SplitInfo::medVolNum, df_SplitInfo::migrationID, df_RecFile_t::name, df_RecFile_t::nameOld, df_SplitInfo::noCopies, ntoh(), df_RecFile_t::numCopies, df_StandardAttr_t::numLinks, df_SplitInfo::numLinks, df_SplitInfo::oldFileName, df_SplitInfo::oldOwnerID, df_SplitInfo::ownerID, df_StandardAttr_t::size, df_SplitInfo::splitOffset, df_SplitInfo::splitSize, df_RecFile_t::stdAttr, df_StandardAttr_t::type, and WriteFRIStart().

                                                                  {
    log_FUNC_m(ProcRecFileHdr);

    UInt32_t blockID(GetBlockID());

    // Prevent invalid medium position to be stored to FSC and FRI
    if (blockID < 3) {
        log_MARKLINE_m;
        throw ivd_InternalError(ie_FATAL_ERROR,
            string("Invalid medium position: ") + cmn_Num2Str(blockID) );
    }

    if (m_friRecNum == 0) {
        // This is the first file header, write FRIStart first
        WriteFRIStart();
    }

    CopyRecord(a_recCmn_p);

    const df_RecFile_t *fh_p = df_GetSpecificRec<df_RecFile_t>(a_recCmn_p);

    m_curSplit.fileType     = static_cast<ivd_FileType_e>( ntoh(fh_p->stdAttr.type) );
    m_curSplit.dataType     = ivd_ATTR_d;
    m_curSplit.numLinks     = ntoh(fh_p->stdAttr.numLinks);
    m_curSplit.lastSplit    = false;        // we do not know yet

    m_splitStartRecorded    = true;

    //
    // Not used when creating FRI
    //
    m_curSplit.medVolNum    = 0;
    m_curSplit.mediaKey     = 0;

    m_curSplit.blockOffset  = blockID;

    m_curSplit.fileID       = static_cast<ivd_FileID_t>(ntoh(fh_p->idFile));
    m_curSplit.migrationID  = ntoh(fh_p->idMig);
    m_curSplit.fileSize     = ntoh(fh_p->stdAttr.size);

    m_curSplit.chunkOffset  = 0;
    m_curSplit.chunkSize    = ntoh(fh_p->chunkSize);

    m_curSplit.noCopies     = ntoh(fh_p->numCopies);

    m_curSplit.splitOffset  = 0;
    m_curSplit.splitSize    = 0;

    m_curSplit.ownerID      = static_cast<ivd_FileID_t>(ntoh(fh_p->idParent));
    m_curSplit.oldOwnerID   = static_cast<ivd_FileID_t>(ntoh(fh_p->idParentOld));

    m_curSplit.fileName = a_recCmn_p->GetVarDataNet(fh_p->name);
    m_curSplit.oldFileName = a_recCmn_p->GetVarDataNet(fh_p->nameOld);

    log_DBG_m(dbg_NORM,
        "File Start: " << m_curSplit.fileID <<
        " copies: " << m_curSplit.noCopies <<
        " filename: " << m_curSplit.fileName <<
        " 1st split:" << ( (ntoh(a_recCmn_p->flags) & df_RF_CONTINUED)? "NO" : "YES") );
}

Here is the call graph for this function:

void df_FRIDistiller::ProcRecRawData ( const UInt8_t a_block_p  )  [private, virtual]

Reimplemented from df_RecReader.

Definition at line 449 of file df_fridistiller.cpp.

References df_BlockProxyWriter::AllocateRawBlock(), CompleteStream(), dbg_LOW, df_ST_META, df_RecReader::DoesBlockContainNewMigration(), df_RecReader::GetBlkSize(), df_RecReader::GetBlockID(), log_DBG_m, log_FUNC_m, m_curSplitSize, m_curStreamSize, df_RecReader::m_curStreamType, m_output, df_BlockProxyWriter::Move(), NULL, and df_RecReader::Reset().

                                                             {

    if (DoesBlockContainNewMigration()) {
        log_FUNC_m(ProcRecRawData);
        log_DBG_m(dbg_LOW,
            "** FOUND NEW MIGRATION AFTER ABORTED. Medium position: " <<
            GetBlockID());
        CompleteStream(false);
        Reset(true, true);
        return;
    }

    UInt32_t blkSize(GetBlkSize());

    m_curSplitSize += blkSize;

    if (   m_curStreamType == df_ST_META
        && m_curStreamSize <= GetBlkSize() ) {
        // Copy meta block to the Writer
        UInt8_t* target = m_output.AllocateRawBlock();
        if (target == NULL) {
            return;
        }

        memcpy(target, a_block_p, blkSize);
        m_output.Move(blkSize);
    }
}

Here is the call graph for this function:

void df_FRIDistiller::WriteCurrentSplit (  ) 
void df_FRIDistiller::WriteFRIEnd ( UInt32_t  a_status  )  [private]

Definition at line 184 of file df_fridistiller.cpp.

References df_BlockProxyWriter::Allocate(), dbg_LOW, df_RecReader::GetBlockID(), log_DBG_m, log_FUNC_m, m_firstBlockID, m_friRecNum, m_medVolID, m_output, m_partID, m_poolID, df_BlockProxyWriter::Move(), NULL, WriteFRIStart(), and df_Packer::WriteRecFRIEnd().

Referenced by ~df_FRIDistiller().

                                                   {
    log_FUNC_m(WriteFRIEnd);

    if (m_friRecNum == 0) {
        // Handle FRI for empty volume, where there's just FRI start and FRI end.
        log_DBG_m(dbg_LOW, "Writing FRIS for empty volume.");
        WriteFRIStart();
    }

    // Write FRIEnd record
    UInt32_t recSize = sizeof(df_RecCmn_t) + sizeof(df_RecFRIEnd_t);
    UInt8_t* recBuf = m_output.Allocate(recSize);

    if (recBuf == NULL) {
        return;
    }

    df_Packer::WriteRecFRIEnd(
        m_medVolID,
        m_poolID,
        m_partID,
        m_firstBlockID,
        GetBlockID(),
        a_status,
        ++m_friRecNum,
        recBuf,
        recSize);

    m_output.Move(recSize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void df_FRIDistiller::WriteFRIStart (  )  [private]

Definition at line 156 of file df_fridistiller.cpp.

References df_BlockProxyWriter::Allocate(), df_RecReader::GetBlockID(), ie_DF_EOD, log_FUNC_m, m_firstBlockID, m_friRecNum, m_medVolID, m_output, m_partID, m_poolID, df_BlockProxyWriter::Move(), NULL, and df_Packer::WriteRecFRIStart().

Referenced by ProcRecFileHdr(), and WriteFRIEnd().

                                    {
    log_FUNC_m(WriteFRIStart);

    m_firstBlockID = GetBlockID();

    // Write FRIStart record
    UInt32_t recSize = sizeof(df_RecCmn_t) + sizeof(df_RecFRIStart_t);
    UInt8_t* recBuf = m_output.Allocate(recSize);
    if (recBuf == NULL) {
        log_MARKLINE_m;
        throw ivd_DFError(ie_DF_EOD, 0, "Unexpected EOD in FRI buffer.", true);
    }

    df_Packer::WriteRecFRIStart(
        m_medVolID,
        m_poolID,
        m_partID,
        m_firstBlockID,
        ++m_friRecNum,
        recBuf,
        recSize);

    m_output.Move(recSize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void df_FRIDistiller::WriteSplitInfo ( const df_RecCmn_t a_fileEnd_p  )  [private]

Definition at line 218 of file df_fridistiller.cpp.

References df_BlockProxyWriter::Allocate(), df_SplitInfo::blockOffset, df_SplitInfo::Clear(), CopyRecord(), df_SplitInfo::dataType, df_SplitInfo::fileID, log_FUNC_m, m_curSplit, m_curSplitSize, m_friRecNum, m_output, m_splitStartRecorded, df_BlockProxyWriter::Move(), NULL, df_SplitInfo::splitOffset, df_SplitInfo::splitSize, and df_Packer::WriteRecFRISplitInfo().

Referenced by CompleteStream(), and ProcRecFileEnd().

                                                                   {
    log_FUNC_m(WriteSplitInfo);

    // Add split info record
    UInt32_t siRecSize = sizeof(df_RecCmn_t) + sizeof(df_RecFRISpInfo_t);
    UInt8_t* siRecBuf = m_output.Allocate(siRecSize);

    if (siRecBuf == NULL) {
        return;
    }

    df_Packer::WriteRecFRISplitInfo(
        m_curSplit.fileID,
        m_curSplit.splitOffset,
        m_curSplit.splitSize,
        m_curSplit.dataType,
        ++m_friRecNum,
        m_curSplit.blockOffset,
        siRecBuf,
        siRecSize);
    m_output.Move(siRecSize);

    // Splits at the end of the medium don't have
    // File End record. That's how FSC detects non-last splits.
    if (a_fileEnd_p != NULL) {
        // Append file end record
        CopyRecord(a_fileEnd_p);
    }

    m_curSplit.Clear();

    m_splitStartRecorded = false;
    m_curSplitSize = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Macro to add class name member s_className.

Reimplemented from df_RecReader.

Definition at line 1630 of file df.h.

Holds information about the split info that is being processed.

Definition at line 1641 of file df.h.

Referenced by CompleteStream(), df_FRIDistiller(), ProcRecBSEnd(), ProcRecBSStart(), ProcRecFileEnd(), ProcRecFileHdr(), and WriteSplitInfo().

Size of the current split.

It is used for splits that end at file mark.

Definition at line 1651 of file df.h.

Referenced by CompleteStream(), HandleDFError(), ProcRecBSEnd(), ProcRecBSStart(), ProcRecEmbData(), ProcRecRawData(), and WriteSplitInfo().

Fast fix 2106.

Exclude stream greater than block size

Definition at line 1644 of file df.h.

Referenced by CompleteStream(), HandleDFError(), ProcRecBSEnd(), ProcRecBSStart(), ProcRecEmbData(), and ProcRecRawData().

Definition at line 1638 of file df.h.

Referenced by WriteFRIEnd(), and WriteFRIStart().

Counter for FRI records.

Definition at line 1654 of file df.h.

Referenced by CopyRecord(), ProcRecFileHdr(), WriteFRIEnd(), WriteFRIStart(), and WriteSplitInfo().

Definition at line 1634 of file df.h.

Referenced by HandleDFError(), WriteFRIEnd(), and WriteFRIStart().

Definition at line 1632 of file df.h.

Referenced by CopyRecord(), ProcRecRawData(), WriteFRIEnd(), WriteFRIStart(), and WriteSplitInfo().

Definition at line 1636 of file df.h.

Referenced by WriteFRIEnd(), and WriteFRIStart().

Definition at line 1635 of file df.h.

Referenced by WriteFRIEnd(), and WriteFRIStart().

Was split offset recorded in m_curSplit?

Definition at line 1647 of file df.h.

Referenced by CompleteStream(), HandleDFError(), ProcBlock(), ProcRecFileHdr(), and WriteSplitInfo().


The documentation for this class was generated from the following files: