virtual void firstExtent(const Extent &e) {
     series.setType(e.getTypePtr());
     const ExtentType::Ptr extent_type(e.getTypePtr());
     fields.reserve(extent_type->getNFields());
     for (uint32_t i = 0; i < extent_type->getNFields(); ++i) {
         string field_name(extent_type->getFieldName(i));
         fields.push_back(GeneralField::make(series, field_name));
         into.columns.push_back(TableColumn(field_name, 
                                            extent_type->getFieldTypeStr(field_name)));
     }
     into.__isset.columns = true;
 }
Example #2
0
 virtual void firstExtent(const Extent &e) {
     skip_after_count.resize(getMaxUnifiedId()+1);
     skip_after_skip.resize(getMaxUnifiedId() +1);
     const ExtentType::Ptr type = e.getTypePtr();
     if (type->versionCompatible(0,0) || type->versionCompatible(1,0)) {
         packet_at.setFieldName("packet-at");
         is_request.setFieldName("is-request");
         op_id.setFieldName("op-id");
         nfs_version.setFieldName("nfs-version");
         transaction_id.setFieldName("transaction-id");
         payload_length.setFieldName("payload-length");
         record_id.setFieldName("record-id");
     } else if (type->versionCompatible(2,0)) {
         packet_at.setFieldName("packet_at");
         is_request.setFieldName("is_request");
         op_id.setFieldName("op_id");
         nfs_version.setFieldName("nfs_version");
         transaction_id.setFieldName("transaction_id");
         payload_length.setFieldName("payload_length");
         record_id.setFieldName("record_id");
     } else {
         FATAL_ERROR(format("can only handle v[0,1,2].*; not %d.%d")
                     % type->majorVersion() % type->minorVersion());
     }
 }
Example #3
0
    void firstExtent(const Extent &b_e) {
        ExtentSeries a_series;

        a_series.setExtent(a_input.getSharedExtent());
        b_series.setType(b_e.getTypePtr());
        if (a_series.getSharedExtent() == NULL) {
            requestError("a_table is empty?");
        }

        // Three possible sources for values in the output:
        // 
        // 1) the a value fields, so from the hash-map
        // 2a) the b fields, as one of the a eq fields.
        // 2b) the b fields, as one of the b values or eq fields
        // 
        // We do not try to optimize the extraction and just create a new general field for each
        // extraction so if the hash-map has duplicate columns, there will be duplicate fields.
        vector<GeneralField::Ptr> a_eq_fields;
        HashUnique<string> known_a_eq_fields;

        BOOST_FOREACH(const CMap::value_type &vt, eq_columns) {
            SINVARIANT(a_series.getTypePtr()->getFieldType(vt.first)
                       == b_series.getTypePtr()->getFieldType(vt.second));
            a_eq_fields.push_back(GeneralField::make(a_series, vt.first));
            b_eq_fields.push_back(GeneralField::make(b_series, vt.second));
            known_a_eq_fields.add(vt.first);
        }
Example #4
0
 virtual void firstExtent(const Extent &e) {
     const ExtentType::Ptr type = e.getTypePtr();
     if (type->getName() == "Network trace: IP packets") {
         packet_at.setFieldName("packet-at");
         wire_len.setFieldName("wire-length");
     } else if (type->getName() == "Trace::Network::IP" &&
                type->versionCompatible(1,0)) {
         packet_at.setFieldName("packet-at");
         wire_len.setFieldName("wire-length");
     } else if (type->getName() == "Trace::Network::IP" &&
                type->versionCompatible(2,0)) {
         packet_at.setFieldName("packet_at");
         wire_len.setFieldName("wire_length");
     } else {
         FATAL_ERROR("?");
     }
 }
Example #5
0
 void firstExtent(const Extent &e) {
     const ExtentType::Ptr type = e.getTypePtr();
     if (type->versionCompatible(0,0) || type->versionCompatible(1,0)) {
         reqtime.setFieldName("packet-at");
         is_request.setFieldName("is-request");
         transaction_id.setFieldName("transaction-id");
         op_id.setFieldName("op-id");
     } else if (type->versionCompatible(2,0)) {
         reqtime.setFieldName("packet_at");
         is_request.setFieldName("is_request");
         transaction_id.setFieldName("transaction_id");
         op_id.setFieldName("op_id");
     } else {
         FATAL_ERROR(format("can only handle v[0,1,2].*; not %d.%d")
                     % type->majorVersion() % type->minorVersion());
     }
 }
 void newExtentHook(const Extent &e) {
     if (series.getTypePtr() != NULL) {
         return; // already did this
     }
     const ExtentType::Ptr type = e.getTypePtr();
     if (type->getName() == "NFS trace: read-write") {
         SINVARIANT(type->getNamespace() == "" &&
                    type->majorVersion() == 0 &&
                    type->minorVersion() == 0);
         is_read.setFieldName("is-read");
     } else if (type->getName() == "Trace::NFS::read-write"
                && type->versionCompatible(1,0)) {
         is_read.setFieldName("is-read");
     } else if (type->getName() == "Trace::NFS::read-write"
                && type->versionCompatible(2,0)) {
         is_read.setFieldName("is_read");
     } else {
         FATAL_ERROR("?");
     }
 }
Example #7
0
 virtual void firstExtent(const Extent &e) {
     const ExtentType::Ptr type = e.getTypePtr();
     if (type->getName() == "Network trace: IP packets"
         || (type->getName() == "Trace::Network::IP" && type->versionCompatible(1,0))) {
         packet_at.setFieldName("packet-at");
         wire_len.setFieldName("wire-length");
         is_udp.setFieldName("udp-tcp");
         source_port.setFieldName("source-port");
         dest_port.setFieldName("destination-port");
     } else if (type->getName() == "Trace::Network::IP" &&
                type->versionCompatible(2,0)) {
         packet_at.setFieldName("packet_at");
         wire_len.setFieldName("wire_length");
         is_udp.setFieldName("udp_tcp");
         source_port.setFieldName("source_port");
         dest_port.setFieldName("destination_port");
     } else {
         FATAL_ERROR("?");
     }
 }
void printIndex(off64_t offset, Extent &extent) {
    cout << offset << "\t" << extent.getTypePtr()->getName() << "\t" << extent.size() << "\n";
}