Skip to content

Commit

Permalink
chore: reformatted code with new formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Feb 8, 2024
1 parent df2e6d5 commit 2396719
Show file tree
Hide file tree
Showing 461 changed files with 5,069 additions and 1,991 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public OChannelBinaryAsynchClient(
+ iProtocolVersion
+ ", server="
+ srvProtocolVersion
+ ". You could not use the full features of the newer version. Assure to have the same versions on both");
+ ". You could not use the full features of the newer version. Assure to have"
+ " the same versions on both");
}

} catch (RuntimeException e) {
Expand Down Expand Up @@ -376,7 +377,8 @@ public void handleException(Throwable throwable) {
OLogManager.instance()
.error(
this,
"Error during exception serialization, serialized exception is not Throwable, exception type is "
"Error during exception serialization, serialized exception is not Throwable,"
+ " exception type is "
+ exceptionType,
null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public OChannelBinaryClientAbstract(
+ protocolVersion
+ ", server="
+ srvProtocolVersion
+ ". You could not use the full features of the newer version. Assure to have the same versions on both");
+ ". You could not use the full features of the newer version. Assure to have"
+ " the same versions on both");
}

} catch (RuntimeException e) {
Expand Down Expand Up @@ -297,7 +298,8 @@ protected void throwSerializedException(final byte[] serializedException) throws
OLogManager.instance()
.error(
this,
"Error during exception serialization, serialized exception is not Throwable, exception type is "
"Error during exception serialization, serialized exception is not Throwable,"
+ " exception type is "
+ exceptionType,
null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ protected static File getConfigurationFile(final String iDirectory) {
"${" + Orient.ORIENTDB_HOME + "}/config/orientdb-server-config.xml"));
if (!file.exists())
throw new OConfigurationException(
"Cannot load file orientdb-server-config.xml to execute remote tests. Current directory is "
"Cannot load file orientdb-server-config.xml to execute remote tests. Current directory"
+ " is "
+ new File(".").getAbsolutePath());
return file;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ public synchronized String getNextAvailableServerURL(
OLogManager.instance()
.debug(
this,
"ROUND_ROBIN_CONNECT: Next remote operation will be executed on server: %s (isConnectOperation=%s)",
"ROUND_ROBIN_CONNECT: Next remote operation will be executed on server: %s"
+ " (isConnectOperation=%s)",
url,
iIsConnectOperation);
break;
Expand All @@ -280,7 +281,8 @@ public synchronized String getNextAvailableServerURL(
OLogManager.instance()
.debug(
this,
"ROUND_ROBIN_REQUEST: Next remote operation will be executed on server: %s (isConnectOperation=%s)",
"ROUND_ROBIN_REQUEST: Next remote operation will be executed on server: %s"
+ " (isConnectOperation=%s)",
url,
iIsConnectOperation);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ public <T> T baseNetworkOperation(
OStorageRemoteSession session = getCurrentSession();
if (session.commandExecuting)
throw new ODatabaseException(
"Cannot execute the request because an asynchronous operation is in progress. Please use a different connection");
"Cannot execute the request because an asynchronous operation is in progress. Please use"
+ " a different connection");

String serverUrl = null;
do {
Expand Down Expand Up @@ -654,12 +655,14 @@ public void reload() {

public void create(OContextConfiguration contextConfiguration) {
throw new UnsupportedOperationException(
"Cannot create a database in a remote server. Please use the console or the OServerAdmin class.");
"Cannot create a database in a remote server. Please use the console or the OServerAdmin"
+ " class.");
}

public boolean exists() {
throw new UnsupportedOperationException(
"Cannot check the existence of a database in a remote server. Please use the console or the OServerAdmin class.");
"Cannot check the existence of a database in a remote server. Please use the console or the"
+ " OServerAdmin class.");
}

public void close(final boolean iForce) {
Expand Down Expand Up @@ -752,7 +755,8 @@ public int removeUser() {

public void delete() {
throw new UnsupportedOperationException(
"Cannot delete a database in a remote server. Please use the console or the OServerAdmin class.");
"Cannot delete a database in a remote server. Please use the console or the OServerAdmin"
+ " class.");
}

public Set<String> getClusterNames() {
Expand Down Expand Up @@ -976,7 +980,8 @@ public List<String> backup(
int bufferSize)
throws IOException {
throw new UnsupportedOperationException(
"backup is not supported against remote storage. Open the database with plocal or use the incremental backup in the Enterprise Edition");
"backup is not supported against remote storage. Open the database with plocal or use the"
+ " incremental backup in the Enterprise Edition");
}

public void restore(
Expand All @@ -986,7 +991,8 @@ public void restore(
final OCommandOutputListener iListener)
throws IOException {
throw new UnsupportedOperationException(
"restore is not supported against remote storage. Open the database with plocal or use Enterprise Edition");
"restore is not supported against remote storage. Open the database with plocal or use"
+ " Enterprise Edition");
}

public OContextConfiguration getClientConfiguration() {
Expand Down Expand Up @@ -2333,7 +2339,8 @@ public void onPushReconnect(String host) {
OLogManager.instance()
.warn(
this,
"Cannot find a valid session for subscribe for event to host '%s' forward the subscribe for the next session open ",
"Cannot find a valid session for subscribe for event to host '%s' forward the"
+ " subscribe for the next session open ",
host);
OStorageRemotePushThread old;
stateLock.writeLock().lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class OStorageRemoteSession {
Collections.newSetFromMap(new WeakHashMap<OChannelBinary, Boolean>());
private final int uniqueClientSessionId;
private boolean closed = true;

/**
* Make the retry to happen only on the current session, if the current session is invalid or the
* server is offline it kill the operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,8 @@ public void freeze(final boolean throwException) {
OLogManager.instance()
.error(
this,
"Only local paginated storage supports freeze. If you are using remote client please use OrientDB instance instead",
"Only local paginated storage supports freeze. If you are using remote client please"
+ " use OrientDB instance instead",
null);

return;
Expand All @@ -1121,7 +1122,8 @@ public void release() {
OLogManager.instance()
.error(
this,
"Only local paginated storage supports release. If you are using remote client please use OrientDB instance instead",
"Only local paginated storage supports release. If you are using remote client please"
+ " use OrientDB instance instead",
null);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public static void checkProtocolVersion(Object caller, int protocolVersion) {
if (NETWORK_BINARY_MIN_PROTOCOL_VERSION.getValueAsInteger() > protocolVersion) {
String message =
String.format(
"Backward compatibility support enabled from version %d your version is %d, check `%s` settings",
"Backward compatibility support enabled from version %d your version is %d, check"
+ " `%s` settings",
NETWORK_BINARY_MIN_PROTOCOL_VERSION.getValueAsInteger(),
protocolVersion,
NETWORK_BINARY_MIN_PROTOCOL_VERSION.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ public void clear() {

stateBuffer.clear();

while (lruList.poll() != null) ;
while (lruList.poll() != null)
;
} finally {
lruLock.unlock();
}
Expand Down Expand Up @@ -788,7 +789,9 @@ private void evict() {
OLogManager.instance()
.debug(
this,
"Reached maximum of opened files %d (max=%d), closed %d files. Consider to raise this limit by increasing the global setting '%s' and the OS limit on opened files per processor",
"Reached maximum of opened files %d (max=%d), closed %d files. Consider to raise this"
+ " limit by increasing the global setting '%s' and the OS limit on opened files"
+ " per processor",
initialSize,
openLimit,
closedFiles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,11 @@ protected Method getMethod(String iCommand) {

protected void syntaxError(String iCommand, Method m) {
error(
"\n!Wrong syntax. If you're running in batch mode make sure all commands are delimited by semicolon (;) or a linefeed (\\n). Expected: \n\r\n\r%s",
"\n"
+ "!Wrong syntax. If you're running in batch mode make sure all commands are delimited"
+ " by semicolon (;) or a linefeed (\\n"
+ "). Expected: \n\r\n\r"
+ "%s",
formatCommandSpecs(iCommand, m));
}

Expand Down Expand Up @@ -685,7 +689,8 @@ protected Map<String, Object> addCommand(Map<String, Object> commandsTree, Strin
@ConsoleCommand(
splitInWords = false,
description =
"Receives help on available commands or a specific one. Use 'help -online <cmd>' to fetch online documentation")
"Receives help on available commands or a specific one. Use 'help -online <cmd>' to fetch"
+ " online documentation")
public void help(
@ConsoleParameter(name = "command", description = "Command to receive help")
String iCommand) {
Expand Down Expand Up @@ -727,7 +732,8 @@ public void help(
// } catch (Exception e) {
// }
error(
"!CANNOT FETCH ONLINE DOCUMENTATION, CHECK IF COMPUTER IS CONNECTED TO THE INTERNET.");
"!CANNOT FETCH ONLINE DOCUMENTATION, CHECK IF COMPUTER IS CONNECTED TO THE"
+ " INTERNET.");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ public void checkMemoryLeaks() {
OLogManager.instance()
.warnNoDb(
this,
"DIRECT-TRACK: memory consumption is not zero (%d bytes), it may indicate presence of memory leaks",
"DIRECT-TRACK: memory consumption is not zero (%d bytes), it may indicate presence"
+ " of memory leaks",
memCons);

assert false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public V newInstance(final K iKey) {
final OSystemException exception =
new OSystemException(
String.format(
"Error on creating new instance of class '%s' registered in factory with key '%s'",
"Error on creating new instance of class '%s' registered in factory with key"
+ " '%s'",
cls, iKey));
throw OException.wrapException(exception, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ public static void atomicMoveWithFallback(Path source, Path target, Object reque
OLogManager.instance()
.warn(
requester,
"atomic file move is not possible, falling back to regular move (moving '%s' to '%s')",
"atomic file move is not possible, falling back to regular move (moving '%s' to"
+ " '%s')",
source,
target);
Files.move(source, target);
Expand Down
10 changes: 6 additions & 4 deletions core/src/main/java/com/orientechnologies/common/jnr/ONative.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public int getOpenFilesLimit(boolean verbose, int recommended, int defLimit) {
OLogManager.instance()
.warnNoDb(
this,
"Value of limit of simultaneously open files is too small, recommended value is %d",
"Value of limit of simultaneously open files is too small, recommended value is"
+ " %d",
recommended);
}
return (int) rLimit.rlimCur() / 2 - 512;
Expand Down Expand Up @@ -213,8 +214,8 @@ public MemoryLimitResult getMemoryLimit(final boolean printSteps) {
OLogManager.instance()
.infoNoDb(
this,
"Can not find '%s' path for memory cgroup, it is supposed that "
+ "process is running in container, will try to read root '%s' memory cgroup data",
"Can not find '%s' path for memory cgroup, it is supposed that process is"
+ " running in container, will try to read root '%s' memory cgroup data",
memoryCGroup,
memoryCGroupRoot);
}
Expand Down Expand Up @@ -412,7 +413,8 @@ private String findMemoryGCGroupPath() {
OLogManager.instance()
.errorNoDb(
this,
"Error during closing of reader which reads details of list of cgroups for the current process",
"Error during closing of reader which reads details of list of cgroups for the"
+ " current process",
e);
}
} catch (final FileNotFoundException fnfe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ public void run() {
OLogManager.instance()
.info(
this,
"Database '%s' uses %,dMB/%,dMB of DISKCACHE memory, while Heap is not completely used (usedHeap=%dMB maxHeap=%dMB). To improve performance set maxHeap to %dMB and DISKCACHE to %dMB",
"Database '%s' uses %,dMB/%,dMB of DISKCACHE memory, while Heap is not"
+ " completely used (usedHeap=%dMB maxHeap=%dMB). To improve performance"
+ " set maxHeap to %dMB and DISKCACHE to %dMB",
s.getName(),
totalDiskCacheUsedMemory,
maxDiskCacheUsedMemory,
Expand All @@ -138,7 +140,8 @@ public void run() {
OLogManager.instance()
.info(
this,
"-> Open server.sh (or server.bat on Windows) and change the following variables: 1) MAXHEAP=-Xmx%dM 2) MAXDISKCACHE=%d",
"-> Open server.sh (or server.bat on Windows) and change the following"
+ " variables: 1) MAXHEAP=-Xmx%dM 2) MAXDISKCACHE=%d",
suggestedMaxHeap / OFileUtils.MEGABYTE,
suggestedDiskCache);
}
Expand Down Expand Up @@ -206,7 +209,8 @@ public static String dumpEnvironment(final String dumpType) {

buffer.append(
String.format(
"OrientDB Memory profiler: HEAP=%s of %s - DISKCACHE (%s dbs)=%s of %s - OS=%s of %s - FS=%s of %s",
"OrientDB Memory profiler: HEAP=%s of %s - DISKCACHE (%s dbs)=%s of %s - OS=%s of"
+ " %s - FS=%s of %s",
OFileUtils.getSizeAsString(runtime.totalMemory() - runtime.freeMemory()),
OFileUtils.getSizeAsString(runtime.maxMemory()),
stgs,
Expand Down Expand Up @@ -333,7 +337,9 @@ else if (h.startsWith("db.") && h.endsWith("txRollback"))

buffer.append(
String.format(
"\nCRUD: C(%d %d/sec) R(%d %d/sec) U(%d %d/sec) D(%d %d/sec) - COMMANDS (%d %d/sec) - TX: COMMIT(%d %d/sec) ROLLBACK(%d %d/sec)",
"\n"
+ "CRUD: C(%d %d/sec) R(%d %d/sec) U(%d %d/sec) D(%d %d/sec) - COMMANDS (%d"
+ " %d/sec) - TX: COMMIT(%d %d/sec) ROLLBACK(%d %d/sec)",
lastCreateRecords,
lastCreateRecordsSec,
lastReadRecords,
Expand Down Expand Up @@ -509,14 +515,16 @@ public void setAutoDump(final int iSeconds) {
OGlobalConfiguration.PROFILER_AUTODUMP_TYPE.getValueAsString();

output.append(
"\n*******************************************************************************************************************************************");
"\n"
+ "*******************************************************************************************************************************************");
output.append(
"\nPROFILER AUTO DUMP '"
+ dumpType
+ "' OUTPUT (to disabled it set 'profiler.autoDump.interval' = 0):\n");
output.append(dump(dumpType));
output.append(
"\n*******************************************************************************************************************************************");
"\n"
+ "*******************************************************************************************************************************************");

OLogManager.instance().info(null, output.toString());
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class ODoubleSerializer implements OBinarySerializer<Double> {
public static final byte ID = 6;

/** size of double value in bytes */
public static final int DOUBLE_SIZE = 8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public class OFloatSerializer implements OBinarySerializer<Float> {

public static final byte ID = 7;

/** size of float value in bytes */
public static final int FLOAT_SIZE = 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public class OIntegerSerializer implements OBinarySerializer<Integer> {

public static final byte ID = 8;

/** size of int value in bytes */
public static final int INT_SIZE = 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public class OLongSerializer implements OBinarySerializer<Long> {

public static final byte ID = 10;

/** size of long value in bytes */
public static final int LONG_SIZE = 8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class OShortSerializer implements OBinarySerializer<Short> {
public static final byte ID = 12;

/** size of short value in bytes */
public static final int SHORT_SIZE = 2;

Expand Down
Loading

0 comments on commit 2396719

Please sign in to comment.