Relax restrictions on minimum memory (#689)

Improve #682

Change-Id: I92ae91b0ab5076566fcbbe10d4d48122ffd9dde5
This commit is contained in:
Linary 2019-09-18 21:44:08 +08:00 committed by zhoney
parent efcd839ee2
commit 4ee38fa79b
8 changed files with 17 additions and 20 deletions

View File

@ -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;
}

View File

@ -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<>(

View File

@ -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);

View File

@ -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();

View File

@ -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() ||

View File

@ -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(

View File

@ -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);

View File

@ -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());