mirror of https://gitee.com/bigwinds/arangodb
small changes
This commit is contained in:
parent
6ac4c809ee
commit
7974b2bc42
|
@ -89,8 +89,7 @@ VPackBuilder BindParameters::StripCollectionNames(VPackSlice const& keys,
|
|||
if (element.isString()) {
|
||||
VPackValueLength l;
|
||||
char const* s = element.getString(l);
|
||||
char search = '/';
|
||||
auto p = static_cast<char const*>(memchr(s, search, l));
|
||||
auto p = static_cast<char const*>(memchr(s, '/', l));
|
||||
if (p != nullptr && strncmp(s, collectionName, p - s) == 0) {
|
||||
// key begins with collection name + '/', now strip it in place for
|
||||
// further comparisons
|
||||
|
|
|
@ -163,7 +163,7 @@ void AffinityFeature::prepare() {
|
|||
void AffinityFeature::start() {
|
||||
if (0 < _threadAffinity) {
|
||||
LOG(INFO) << "the server has " << _n << " (hyper) cores, using " << _ns
|
||||
<< " scheduler threads, " << _nd << " dispatcher threads";
|
||||
<< " scheduler thread(s), " << _nd << " dispatcher thread(s)";
|
||||
|
||||
if (0 < _ns) {
|
||||
LOG(DEBUG) << "scheduler cores: " << _ps;
|
||||
|
@ -182,6 +182,6 @@ void AffinityFeature::start() {
|
|||
size_t ns = (scheduler == nullptr ? 0 : scheduler->concurrency());
|
||||
|
||||
LOG(INFO) << "the server has " << _n << " (hyper) cores, using " << ns
|
||||
<< " scheduler threads, " << nd << " dispatcher threads";
|
||||
<< " scheduler thread(s), " << nd << " dispatcher thread(s)";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,6 +118,11 @@ static void EdgesQuery(TRI_edge_direction_e direction,
|
|||
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
||||
}
|
||||
|
||||
if (collection->_type != TRI_COL_TYPE_EDGE) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID);
|
||||
}
|
||||
|
||||
|
||||
auto addOne = [](v8::Isolate* isolate, VPackBuilder* builder, v8::Handle<v8::Value> const val) {
|
||||
if (val->IsString() || val->IsStringObject()) {
|
||||
builder->add(VPackValue(TRI_ObjectToString(val)));
|
||||
|
@ -161,10 +166,6 @@ static void EdgesQuery(TRI_edge_direction_e direction,
|
|||
filter = buildFilter(direction, "==");
|
||||
}
|
||||
|
||||
if (collection->_type != TRI_COL_TYPE_EDGE) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID);
|
||||
}
|
||||
|
||||
std::string const queryString = "FOR doc IN @@collection " + filter + " RETURN doc";
|
||||
v8::Handle<v8::Value> result = AqlQuery(isolate, collection, queryString, bindVars).result;
|
||||
|
||||
|
@ -203,6 +204,8 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
limit = TRI_ObjectToUInt64(args[1], false);
|
||||
}
|
||||
|
||||
std::string collectionName(collection->_name);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(collection->_vocbase, true),
|
||||
collection->_cid, TRI_TRANSACTION_READ);
|
||||
|
||||
|
@ -212,8 +215,6 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_V8_THROW_EXCEPTION(res);
|
||||
}
|
||||
|
||||
std::string collectionName(collection->_name);
|
||||
|
||||
// We directly read the entire cursor. so batchsize == limit
|
||||
std::shared_ptr<OperationCursor> opCursor =
|
||||
trx.indexScan(collectionName, Transaction::CursorType::ALL,
|
||||
|
@ -286,7 +287,7 @@ static void JS_AnyQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
||||
}
|
||||
|
||||
TRI_doc_mptr_t document;
|
||||
std::string collectionName(col->_name);
|
||||
|
||||
SingleCollectionTransaction trx(V8TransactionContext::Create(col->_vocbase, true),
|
||||
col->_cid, TRI_TRANSACTION_READ);
|
||||
|
@ -297,7 +298,6 @@ static void JS_AnyQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_V8_THROW_EXCEPTION(res);
|
||||
}
|
||||
|
||||
std::string collectionName(col->_name);
|
||||
OperationResult cursor = trx.any(collectionName);
|
||||
|
||||
res = trx.finish(cursor.code);
|
||||
|
|
Loading…
Reference in New Issue