forked from hugegraph/hugegraph
Relax restrictions on minimum memory (#689)
Improve #682 Change-Id: I92ae91b0ab5076566fcbbe10d4d48122ffd9dde5
This commit is contained in:
parent
efcd839ee2
commit
4ee38fa79b
|
|
@ -34,7 +34,6 @@ import javax.ws.rs.ext.Provider;
|
|||
import com.baidu.hugegraph.config.HugeConfig;
|
||||
import com.baidu.hugegraph.config.ServerOptions;
|
||||
import com.baidu.hugegraph.define.WorkLoad;
|
||||
import com.baidu.hugegraph.license.LicenseVerifier;
|
||||
import com.baidu.hugegraph.util.Bytes;
|
||||
import com.baidu.hugegraph.util.E;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
|
@ -63,8 +62,6 @@ public class LoadDetectFilter implements ContainerRequestFilter {
|
|||
|
||||
@Override
|
||||
public void filter(ContainerRequestContext context) {
|
||||
LicenseVerifier.instance().verifyIfNeeded();
|
||||
|
||||
if (LoadDetectFilter.isWhiteAPI(context)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,19 +70,19 @@ public class ServerOptions extends OptionHolder {
|
|||
"The minmium free memory(MB) of rest server, requests " +
|
||||
"will be rejected when the available memory of system " +
|
||||
"is lower than this value.",
|
||||
positiveInt(),
|
||||
256
|
||||
nonNegativeInt(),
|
||||
64
|
||||
);
|
||||
|
||||
|
||||
public static final ConfigOption<Integer> REQUEST_TIMEOUT =
|
||||
new ConfigOption<>(
|
||||
"restserver.request_timeout",
|
||||
"The time in seconds within which a request must complete, " +
|
||||
"-1 means no timeout.",
|
||||
rangeInt(-1, Integer.MAX_VALUE),
|
||||
30
|
||||
);
|
||||
new ConfigOption<>(
|
||||
"restserver.request_timeout",
|
||||
"The time in seconds within which a request must complete, " +
|
||||
"-1 means no timeout.",
|
||||
rangeInt(-1, Integer.MAX_VALUE),
|
||||
30
|
||||
);
|
||||
|
||||
public static final ConfigOption<Integer> CONN_IDLE_TIMEOUT =
|
||||
new ConfigOption<>(
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public final class GraphManager {
|
|||
}
|
||||
|
||||
this.loadGraphs(conf.getMap(ServerOptions.GRAPHS));
|
||||
this.installLicense(conf);
|
||||
// this.installLicense(conf);
|
||||
this.checkBackendVersionOrExit();
|
||||
this.restoreUncompletedTasks();
|
||||
this.addMetrics(conf);
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ public class GraphIndexTransaction extends AbstractTransaction {
|
|||
ConditionQuery query) {
|
||||
SchemaTransaction schema = this.graph().schemaTransaction();
|
||||
Set<IndexLabel> ils = InsertionOrderUtil.newSet();
|
||||
for(Id il : schemaLabel.indexLabels()) {
|
||||
for (Id il : schemaLabel.indexLabels()) {
|
||||
ils.add(schema.getIndexLabel(il));
|
||||
}
|
||||
if (ils.isEmpty()) {
|
||||
|
|
@ -753,7 +753,7 @@ public class GraphIndexTransaction extends AbstractTransaction {
|
|||
}
|
||||
}
|
||||
// Must match all fields
|
||||
if(indexFields.equals(queryPropKeys)) {
|
||||
if (indexFields.equals(queryPropKeys)) {
|
||||
return matchedIndexLabels;
|
||||
} else {
|
||||
return ImmutableSet.of();
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class HugeFeatures implements Graph.Features {
|
|||
|
||||
@Override
|
||||
public boolean willAllowId(Object id) {
|
||||
if(!this.supportsUserSuppliedIds()) {
|
||||
if (!this.supportsUserSuppliedIds()) {
|
||||
return false;
|
||||
} else {
|
||||
return this.supportsAnyIds() ||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public final class HugeScriptTraversal<S, E> extends DefaultTraversal<S, E> {
|
|||
.withStrategies(strategies));
|
||||
bindings.put("graph", this.graph);
|
||||
|
||||
for(Map.Entry<String, String> entry : this.aliases.entrySet()) {
|
||||
for (Map.Entry<String, String> entry : this.aliases.entrySet()) {
|
||||
Object value = bindings.get(entry.getValue());
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ public class PaloSessions extends MysqlSessions {
|
|||
Lock lock = PaloSessions.this.locks.get(sessionId).writeLock();
|
||||
lock.lock();
|
||||
try {
|
||||
String table = file.table();;
|
||||
String table = file.table();
|
||||
String data = file.readAsString();
|
||||
String label = this.formatLabel(table);
|
||||
this.client.bulkLoadAsync(table, data, label);
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ public class BytesBufferTest extends BaseUnitTest {
|
|||
Assert.assertEquals(value, BytesBuffer.wrap(bytes).readProperty(pkey));
|
||||
|
||||
pkey = genListPkey(DataType.INT);
|
||||
value = ImmutableList.of(127, 128);;
|
||||
value = ImmutableList.of(127, 128);
|
||||
bytes = genBytes("027f8100");
|
||||
buf.flip();
|
||||
Assert.assertArrayEquals(bytes, buf.writeProperty(pkey, value).bytes());
|
||||
|
|
@ -890,7 +890,7 @@ public class BytesBufferTest extends BaseUnitTest {
|
|||
Assert.assertEquals(value, BytesBuffer.wrap(bytes).readProperty(pkey));
|
||||
|
||||
pkey = genSetPkey(DataType.INT);
|
||||
value = ImmutableSet.of(127, 128);;
|
||||
value = ImmutableSet.of(127, 128);
|
||||
bytes = genBytes("027f8100");
|
||||
buf.flip();
|
||||
Assert.assertArrayEquals(bytes, buf.writeProperty(pkey, value).bytes());
|
||||
|
|
|
|||
Loading…
Reference in New Issue