Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check-style compile warnings in server #2437

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3559ace
refact: move dirs into hugegraph-server
VGalaxies Aug 1, 2023
9068cef
refact: create dirs for hugegraph-pd and hugegraph-store
VGalaxies Aug 2, 2023
fd161f2
refact: init root pom for all modules
VGalaxies Aug 4, 2023
49a1acf
fix: fix parent of submodules in hugegraph-server
VGalaxies Aug 4, 2023
fca91b2
fix: path
msgui Aug 13, 2023
8465927
fix: conf path
msgui Aug 13, 2023
3b791ee
fix: 1.10 -> 1.11
msgui Aug 13, 2023
ae90ba6
Revert "fix: 1.10 -> 1.11"
msgui Aug 14, 2023
ce5ddbf
fix: version 1.0.0 -> 1.5.0
msgui Aug 14, 2023
8a7ed6a
fix:
msgui Aug 14, 2023
242786b
check
msgui Aug 16, 2023
2e401de
fix: SERVER_DIR
msgui Aug 16, 2023
67de746
fix
msgui Aug 16, 2023
edb77ef
fix
msgui Aug 16, 2023
764dd89
fix: SERVER_DIR
msgui Aug 16, 2023
9a2f2e6
Merge pull request #5 from msgui/fix_CI
msgui Aug 17, 2023
4f68641
test
msgui Sep 9, 2023
d582a51
Merge pull request #14 from msgui/new-fix-depedency-review
msgui Sep 9, 2023
80cf036
Merge branch 'master' of https://github.com/msgui/incubator-hugegraph
msgui Sep 13, 2023
2b241dd
Merge branch 'master' of https://github.com/msgui/incubator-hugegraph
msgui Oct 12, 2023
5b5560f
Merge branch 'master' of https://github.com/msgui/incubator-hugegraph
msgui Nov 28, 2023
016d451
Merge branch 'apache:master' into master
msgui Dec 5, 2023
c7d7c93
chore
msgui Dec 5, 2023
644e15e
Merge branch 'apache:master' into master
msgui Dec 7, 2023
0e14a96
Merge branch 'apache:master' into master
msgui Dec 9, 2023
51dd042
Merge branch 'apache:master' into master
msgui Jan 30, 2024
5c19a5a
add: Configure all files to use LF
msgui Feb 1, 2024
e5ebbb4
format hg-server-api
msgui Feb 1, 2024
65a3161
format hg-server-cassandra
msgui Feb 1, 2024
642fd3a
format hg-server-core
msgui Feb 1, 2024
604fbde
format hg-server-dist
msgui Feb 1, 2024
d898038
format hg-server-example
msgui Feb 1, 2024
7ea6d21
format hg-server-hbase
msgui Feb 1, 2024
7f39c04
format hg-server-mysql
msgui Feb 1, 2024
c546885
format hg-server-palo
msgui Feb 1, 2024
ead9b34
format hg-server-postgresql
msgui Feb 1, 2024
37cf9b1
format hg-server-rocksdb
msgui Feb 1, 2024
15ef231
format hg-server-scylladb
msgui Feb 1, 2024
579a6a2
format hg-server-test
msgui Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format hg-server-core
  • Loading branch information
msgui committed Feb 1, 2024
commit 642fd3ad7affde7c49b06464c63334e4a7e7603d
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph;
Expand Down Expand Up @@ -41,10 +43,6 @@ public HugeException(String message, Throwable cause, Object... args) {
super(String.format(message, args), cause);
}

public Throwable rootCause() {
return rootCause(this);
}

public static Throwable rootCause(Throwable e) {
Throwable cause = e;
while (cause.getCause() != null) {
Expand All @@ -59,4 +57,8 @@ public static boolean isInterrupted(Throwable e) {
rootCause instanceof TraversalInterruptedException ||
rootCause instanceof InterruptedIOException;
}

public Throwable rootCause() {
return rootCause(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph;
Expand Down Expand Up @@ -41,7 +43,9 @@
public class HugeFactory {

private static final Logger LOG = Log.logger(HugeFactory.class);

private static final String NAME_REGEX = "^[A-Za-z][A-Za-z0-9_]{0,47}$";
private static final Map<String, HugeGraph> GRAPHS = new HashMap<>();
private static final AtomicBoolean SHUT_DOWN = new AtomicBoolean(false);
private static final Thread SHUT_DOWN_HOOK = new Thread(() -> {
LOG.info("HugeGraph is shutting down");
HugeFactory.shutdown(30L, true);
Expand All @@ -54,12 +58,6 @@ public class HugeFactory {
Runtime.getRuntime().addShutdownHook(SHUT_DOWN_HOOK);
}

private static final String NAME_REGEX = "^[A-Za-z][A-Za-z0-9_]{0,47}$";

private static final Map<String, HugeGraph> GRAPHS = new HashMap<>();

private static final AtomicBoolean SHUT_DOWN = new AtomicBoolean(false);

public static synchronized HugeGraph open(Configuration config) {
HugeConfig conf = config instanceof HugeConfig ?
(HugeConfig) config : new HugeConfig(config);
Expand Down Expand Up @@ -145,7 +143,8 @@ public static void shutdown(long timeout) {

/**
* Stop all the daemon threads
* @param timeout wait in seconds
*
* @param timeout wait in seconds
* @param ignoreException don't throw exception if true
*/
public static void shutdown(long timeout, boolean ignoreException) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph;
Expand Down Expand Up @@ -64,6 +66,18 @@
*/
public interface HugeGraph extends Graph {

static void registerTraversalStrategies(Class<?> clazz) {
TraversalStrategies strategies = TraversalStrategies.GlobalCache
.getStrategies(Graph.class)
.clone();
strategies.addStrategies(HugeVertexStepStrategy.instance(),
HugeGraphStepStrategy.instance(),
HugeCountStepStrategy.instance(),
HugePrimaryKeyStrategy.instance());

TraversalStrategies.GlobalCache.registerStrategies(clazz, strategies);
}

HugeGraph hugegraph();

SchemaManager schema();
Expand Down Expand Up @@ -249,7 +263,7 @@ public interface HugeGraph extends Graph {
<K, V> V option(TypedOption<K, V> option);

void registerRpcServices(RpcServiceConfig4Server serverConfig,
RpcServiceConfig4Client clientConfig);
RpcServiceConfig4Client clientConfig);

default List<String> mapPkId2Name(Collection<Id> ids) {
List<String> names = new ArrayList<>(ids.size());
Expand Down Expand Up @@ -313,16 +327,4 @@ default Id[] mapVlName2Id(String[] vertexLabels) {
}
return ids;
}

static void registerTraversalStrategies(Class<?> clazz) {
TraversalStrategies strategies = TraversalStrategies.GlobalCache
.getStrategies(Graph.class)
.clone();
strategies.addStrategies(HugeVertexStepStrategy.instance(),
HugeGraphStepStrategy.instance(),
HugeCountStepStrategy.instance(),
HugePrimaryKeyStrategy.instance());

TraversalStrategies.GlobalCache.registerStrategies(clazz, strategies);
}
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph;

import org.apache.hugegraph.analyzer.Analyzer;
import org.apache.hugegraph.backend.LocalCounter;
import org.apache.hugegraph.backend.serializer.AbstractSerializer;
import org.apache.hugegraph.backend.store.BackendFeatures;
import org.apache.hugegraph.backend.store.BackendStore;
import org.apache.hugegraph.backend.store.ram.RamTable;
import org.apache.hugegraph.backend.tx.GraphTransaction;
import org.apache.hugegraph.backend.tx.SchemaTransaction;
import org.apache.hugegraph.config.HugeConfig;
import org.apache.hugegraph.event.EventHub;
import org.apache.hugegraph.job.EphemeralJob;
import org.apache.hugegraph.task.ServerInfoManager;
import org.apache.hugegraph.type.define.GraphMode;
import org.apache.hugegraph.type.define.GraphReadMode;
import org.apache.hugegraph.analyzer.Analyzer;
import org.apache.hugegraph.backend.serializer.AbstractSerializer;
import org.apache.hugegraph.config.HugeConfig;
import org.apache.hugegraph.event.EventHub;

import com.google.common.util.concurrent.RateLimiter;

/**
Expand Down
Loading