Пример #1
0
////////////////////////////////////////////////////////////////////////
// functions of ibis::sbiad
//
/// Constructor.  If an index exists in the specified location, it will be
/// read, otherwise a new bitmap index will be created from current data.
ibis::sbiad::sbiad(const ibis::column* c, const char* f, const uint32_t nbase)
    : ibis::fade(0) {
    if (c == 0) return;  // nothing can be done
    col = c;
    try {
	if (c->partition()->nRows() < 1000000) {
	    construct1(f, nbase); // uses more temporary space
	}
	else {
	    construct2(f, nbase); // scan data twice
	}
	if (ibis::gVerbose > 2) {
	    ibis::util::logger lg;
	    lg() << "sbiad[" << col->partition()->name() << '.' << col->name()
		 << "]::ctor -- constructed a " << bases.size()
		 << "-component interval index with "
		 << bits.size() << " bitmap" << (bits.size()>1?"s":"")
		 << " for " << nrows << " row" << (nrows>1?"s":"");
	    if (ibis::gVerbose > 6) {
		lg() << "\n";
		print(lg());
	    }
	}
    }
    catch (...) {
	LOGGER(ibis::gVerbose > 1)
	    << "Warning -- sbiad[" << col->partition()->name() << '.'
	    << col->name() << "]::ctor received an exception, cleaning up ...";
	clear();
	throw;
    }
} // constructor
Пример #2
0
/// Construct a bitmap index from current data.
ibis::skive::skive(const ibis::column* c, const char* f) : ibis::relic(0) {
    if (c == 0) return;  // nothing can be done
    col = c;
    try {
	if (c->partition()->nRows() < 1000000) {
	    construct1(f);
	}
	else {
	    construct2(f);
	}
	if (ibis::gVerbose > 2) {
	    ibis::util::logger lg;
	    const uint32_t card = vals.size();
	    const uint32_t nbits = bits.size();
	    lg() << "skive[" << col->partition()->name() << '.' << col->name()
		 << "]::ctor -- constructed a binary encoded index with "
		 << nbits << " bitmap" << (nbits>1?"s":"") << " on " << card
		 << " distinct value" << (card>1?"s":"") << " and " << nrows
		 << " row" << (nrows>1?"s":"");
	    if (ibis::gVerbose > 6) {
		lg() << "\n";
		print(lg());
	    }
	}
    }
    catch (...) {
	LOGGER(ibis::gVerbose > 1)
	    << "Warning -- skive[" << col->partition()->name() << '.'
	    << col->name() << "]::ctor receiveed an exception, cleaning up ...";
	clear();
	throw;
    }
} // constructor
Пример #3
0
// create index based data in dt -- have to start from data directly
long ibis::sbiad::append(const char* dt, const char* df, uint32_t nnew) {
    const uint32_t nb = bases.size();
    clear();		// clear the current content
    construct2(dt, nb); // scan data twice to build the new index
    //write(dt);		// write out the new content
    return nnew;
} // ibis::sbiad::append
int HttpCommunicator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: finishedRequest(); break;
        case 1: finishedSlot((*reinterpret_cast< QNetworkReply*(*)>(_a[1]))); break;
        case 2: downloadProgress((*reinterpret_cast< qint64(*)>(_a[1])),(*reinterpret_cast< qint64(*)>(_a[2]))); break;
        case 3: uploadProgress((*reinterpret_cast< qint64(*)>(_a[1])),(*reinterpret_cast< qint64(*)>(_a[2]))); break;
        case 4: downloadReadyRead(); break;
        case 5: construct2(); break;
        default: ;
        }
        _id -= 6;
    }
    return _id;
}