Skip to content

Commit

Permalink
Minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Oct 27, 2023
1 parent 3c231dd commit 9420794
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@


@Slf4j
@Command(name = "dump", description = "Dump tupels of an entity to a file.")
@Command(name = "dump", description = "Dump tuples of an entity to a file.")
public class DumpCommand implements CliRunnable {

@SuppressWarnings("SpringAutowiredFieldsWarningInspection")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/polypheny/simpleclient/cli/Mode.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
package org.polypheny.simpleclient.cli;

public enum Mode {
POLYPHENY, NATIVE, SURREALDB;
POLYPHENY, NATIVE, SURREALDB
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void reset() throws ExecutorException {
@Override
public long executeQueryAndGetNumber( Query query ) throws ExecutorException {
throw new ExecutorException( "Unsupported Operation" );
};
}


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@

package org.polypheny.simpleclient.executor;

import java.io.File;
import lombok.extern.slf4j.Slf4j;
import org.polypheny.control.client.PolyphenyControlConnector;
import org.polypheny.simpleclient.executor.PolyphenyDbJdbcExecutor.PolyphenyDbJdbcExecutorFactory;
import org.polypheny.simpleclient.query.Query;
import org.polypheny.simpleclient.scenario.AbstractConfig;
import org.polypheny.simpleclient.scenario.oltpbench.AbstractOltpBenchConfig;

import java.io.File;


@Slf4j
public class OltpBenchPolyphenyDbExecutor extends OltpBenchExecutor implements PolyphenyDbExecutor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@

package org.polypheny.simpleclient.executor;

import lombok.extern.slf4j.Slf4j;
import org.polypheny.simpleclient.main.CsvWriter;
import org.polypheny.simpleclient.query.RawQuery;

import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import lombok.extern.slf4j.Slf4j;
import org.polypheny.simpleclient.main.CsvWriter;
import org.polypheny.simpleclient.query.RawQuery;


@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
package org.polypheny.simpleclient.executor;

import com.google.gson.JsonObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import kong.unirest.HttpRequest;
import kong.unirest.HttpResponse;
import kong.unirest.JsonNode;
Expand All @@ -39,12 +44,6 @@
import org.polypheny.simpleclient.query.RawQuery;
import org.polypheny.simpleclient.scenario.AbstractConfig;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;


@Slf4j
public class PolyphenyDbRestExecutor implements PolyphenyDbExecutor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.polypheny.simpleclient.executor.Executor;
import org.polypheny.simpleclient.executor.ExecutorException;
import org.polypheny.simpleclient.query.QueryListEntry;
import org.polypheny.simpleclient.scenario.graph.GraphBench;
import org.polypheny.simpleclient.scenario.graph.GraphBench.EvaluationThreadMonitor;

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
public class Coms extends Scenario {

public static final String NAMESPACE = "coms";
public static final double EPSILLON = 0.000001;
public static final double EPSILON = 0.000001;

private final Random random;
private final ComsConfig config;
Expand Down Expand Up @@ -256,7 +256,7 @@ private final void startEvaluation( ProgressReporter progressReporter, CsvWriter
int i = 0;
float amount = 0;
for ( int t : threadDistribution ) {
if ( (amount + (part * t) > (1 - EPSILLON)) && (1 - amount > (part * t) / 2) ) {
if ( (amount + (part * t) > (1 - EPSILON)) && (1 - amount > (part * t) / 2) ) {
// execute in new Thread, "significantly" bigger than 1
organized.add( queryLists[i] );
amount += (part * t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public class NetworkGenerator {
* Network architecture relies on a low amount of main architecture
* with a low connectivity.
* Depending on size of users, switches and APs are deployed.
*
* @param config
*/
public NetworkGenerator( ComsConfig config ) {
this.random = new Random( config.seed );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ void generateAuctions( int start, int end ) throws ExecutorException {
LocalDateTime dt;
LocalDateTime dtLast = startDate;

// Bids should be in a temporal order. In order to avoid the case where it randomly pics the end date we calculate
// an offset of seconds we need to add to the end data in every iteration. This leeds to a somehow even distribution of the
// bits over time.
// Bids should be in a temporal order. In order to avoid the case where it randomly picks the end date we calculate
// an offset of seconds we need to add to the end data in every iteration. This leeds to a somehow even distribution
// of the bits over time.
long difference = ChronoUnit.SECONDS.between( startDate, endDate );
long offset = difference / numberOfBids;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public String getSqlRowExpression() {
+ amount + ","
+ "timestamp '" + date.format( DateTimeFormatter.ofPattern( "yyyy-MM-dd HH:mm:ss" ) ) + "',"
+ userId + ","
+ auctionId // This could gets a bug if e.g. parallelized
+ auctionId // This could become a bug if e.g. parallelized
+ ")";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public class GraphBench extends Scenario {

private final GraphBenchConfig config;

;
private long executeRuntime;
private final Map<Integer, String> queryTypes;

Expand Down

0 comments on commit 9420794

Please sign in to comment.