mirror of https://gitee.com/bigwinds/arangodb
Fixed edge index
This commit is contained in:
parent
b8a938180f
commit
3eb1723dec
|
@ -600,7 +600,7 @@ void HeartbeatThread::runCoordinator() {
|
||||||
usleep(500000);
|
usleep(500000);
|
||||||
remain -= 0.5;
|
remain -= 0.5;
|
||||||
} else {
|
} else {
|
||||||
usleep((unsigned long)(remain * 1000.0 * 1000.0));
|
usleep((TRI_usleep_t)(remain * 1000.0 * 1000.0));
|
||||||
remain = 0.0;
|
remain = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ RocksDBEdgeIndexIterator::~RocksDBEdgeIndexIterator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RocksDBEdgeIndexIterator::next(TokenCallback const& cb, size_t limit) {
|
bool RocksDBEdgeIndexIterator::next(TokenCallback const& cb, size_t limit) {
|
||||||
THROW_ARANGO_NOT_YET_IMPLEMENTED();
|
|
||||||
|
|
||||||
if (limit == 0 || !_iterator.valid()) {
|
if (limit == 0 || !_iterator.valid()) {
|
||||||
// No limit no data, or we are actually done. The last call should have
|
// No limit no data, or we are actually done. The last call should have
|
||||||
|
@ -95,6 +94,9 @@ bool RocksDBEdgeIndexIterator::next(TokenCallback const& cb, size_t limit) {
|
||||||
|
|
||||||
while (limit > 0) {
|
while (limit > 0) {
|
||||||
VPackSlice fromTo = _iterator.value();
|
VPackSlice fromTo = _iterator.value();
|
||||||
|
if (fromTo.isObject()) {
|
||||||
|
fromTo = fromTo.get(StaticStrings::IndexEq);
|
||||||
|
}
|
||||||
TRI_ASSERT(fromTo.isString());
|
TRI_ASSERT(fromTo.isString());
|
||||||
|
|
||||||
RocksDBKeyBounds prefix = RocksDBKeyBounds::EdgeIndexVertex(
|
RocksDBKeyBounds prefix = RocksDBKeyBounds::EdgeIndexVertex(
|
||||||
|
@ -230,8 +232,11 @@ int RocksDBEdgeIndex::insert(transaction::Methods* trx,
|
||||||
|
|
||||||
rocksdb::Status status =
|
rocksdb::Status status =
|
||||||
rtrx->Put(rocksdb::Slice(key.string()), rocksdb::Slice());
|
rtrx->Put(rocksdb::Slice(key.string()), rocksdb::Slice());
|
||||||
Result res = rocksutils::convertStatus(status);
|
if (status.ok()) {
|
||||||
return res.errorNumber();
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
} else {
|
||||||
|
return rocksutils::convertStatus(status).errorNumber();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int RocksDBEdgeIndex::remove(transaction::Methods* trx,
|
int RocksDBEdgeIndex::remove(transaction::Methods* trx,
|
||||||
|
@ -247,8 +252,11 @@ int RocksDBEdgeIndex::remove(transaction::Methods* trx,
|
||||||
RocksDBTransactionState* state = rocksutils::toRocksTransactionState(trx);
|
RocksDBTransactionState* state = rocksutils::toRocksTransactionState(trx);
|
||||||
rocksdb::Transaction* rtrx = state->rocksTransaction();
|
rocksdb::Transaction* rtrx = state->rocksTransaction();
|
||||||
rocksdb::Status status = rtrx->Delete(rocksdb::Slice(key.string()));
|
rocksdb::Status status = rtrx->Delete(rocksdb::Slice(key.string()));
|
||||||
Result res = rocksutils::convertStatus(status, rocksutils::StatusHint::index);
|
if (status.ok()) {
|
||||||
return res.errorNumber();
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
} else {
|
||||||
|
return rocksutils::convertStatus(status).errorNumber();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RocksDBEdgeIndex::batchInsert(
|
void RocksDBEdgeIndex::batchInsert(
|
||||||
|
|
|
@ -357,13 +357,14 @@ std::shared_ptr<Index> RocksDBIndexFactory::prepareIndexFromSlice(
|
||||||
new arangodb::RocksDBEdgeIndex(iid, col, StaticStrings::FromString));
|
new arangodb::RocksDBEdgeIndex(iid, col, StaticStrings::FromString));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// case arangodb::Index::TRI_IDX_TYPE_HASH_INDEX: {
|
case arangodb::Index::TRI_IDX_TYPE_HASH_INDEX: {
|
||||||
|
LOG_TOPIC(WARN, Logger::FIXME) << "Hash Index not implemented";
|
||||||
// // TODO: fix this wrong index type. only used temporarily because we
|
// // TODO: fix this wrong index type. only used temporarily because we
|
||||||
// don't have other indexes
|
// don't have other indexes
|
||||||
// newIdx.reset(new arangodb::RocksDBEdgeIndex(db, iid, col,
|
// newIdx.reset(new arangodb::RocksDBEdgeIndex(db, iid, col,
|
||||||
// StaticStrings::FromString));
|
// StaticStrings::FromString));
|
||||||
// break;
|
// break;
|
||||||
//}
|
}
|
||||||
|
|
||||||
case arangodb::Index::TRI_IDX_TYPE_UNKNOWN:
|
case arangodb::Index::TRI_IDX_TYPE_UNKNOWN:
|
||||||
default: {
|
default: {
|
||||||
|
|
Loading…
Reference in New Issue