Skip to content

Commit

Permalink
./gradlew format
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobin Baker committed Jun 8, 2016
1 parent 84fb780 commit fb7ae5c
Show file tree
Hide file tree
Showing 504 changed files with 10,838 additions and 7,111 deletions.
4 changes: 2 additions & 2 deletions src/edu/washington/escience/myria/CsvTupleWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* {@link CSVPrinter} to do the underlying serialization. The fields to be output may contain special characters such as
* newlines, because fields may be quoted (using double quotes '"'). Double quotation marks inside of fields are escaped
* using the CSV-standard trick of replacing '"' with '""'.
*
*
* CSV files should be compatible with Microsoft Excel.
*
*
*/
public class CsvTupleWriter implements TupleWriter {

Expand Down
15 changes: 9 additions & 6 deletions src/edu/washington/escience/myria/DbException.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public DbException() {
/**
* Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be
* initialized by a call to {@link #initCause}.
*
*
* @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()}
* method.
*/
Expand All @@ -28,7 +28,7 @@ public DbException(final String message) {
* <p>
* Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated in this
* exception's detail message.
*
*
* @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
* value is permitted, and indicates that the cause is nonexistent or unknown.)
Expand All @@ -43,7 +43,7 @@ public DbException(final String message, final Throwable cause) {
* <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of
* <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other throwables
* (for example, {@link java.security.PrivilegedActionException}).
*
*
* @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
* value is permitted, and indicates that the cause is nonexistent or unknown.)
* @since 1.4
Expand All @@ -55,16 +55,19 @@ public DbException(final Throwable cause) {
/**
* Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and writable
* stack trace enabled or disabled.
*
*
* @param message the detail message.
* @param cause the cause. (A {@code null} value is permitted, and indicates that the cause is nonexistent or
* unknown.)
* @param enableSuppression whether or not suppression is enabled or disabled
* @param writableStackTrace whether or not the stack trace should be writable
* @since 1.7
*/
protected DbException(final String message, final Throwable cause, final boolean enableSuppression,
protected DbException(
final String message,
final Throwable cause,
final boolean enableSuppression,
final boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
}
13 changes: 7 additions & 6 deletions src/edu/washington/escience/myria/JsonTupleWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
/**
* JsonTupleWriter is a {@link TupleWriter} that serializes tuples to JavaScript Object Notation (JSON). The output is a
* list of objects, each of which has one field 'attribute' : 'value' per column.
*
*
* For a dataset that has two integer columns names 'x' and 'y', and three rows, the output will look like
*
*
* <pre>
* [{"x":1,"y":2},{"x":3,"y":4},{"x":5,"y":6}]
* </pre>
*
*
* Attribute names (column names) are {@link String} objects that are escaped for JSON. For values, primitive types are
* output unquoted and as-is; {@link DateTime} objects are quoted and serialized in ISO8601 format, and {@link String}
* objects are quoted and escaped for JSON.
*
*
*
*
*/
public class JsonTupleWriter implements TupleWriter {

Expand Down Expand Up @@ -206,7 +206,8 @@ public void error() throws IOException {
} else {
output.write("{");
}
output.write("\"error\":\"There was an error. Investigate the query status to see the message\"}]");
output.write(
"\"error\":\"There was an error. Investigate the query status to see the message\"}]");
output.flush();
} finally {
output.close();
Expand Down
76 changes: 58 additions & 18 deletions src/edu/washington/escience/myria/MyriaConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* This class holds the constants for the Myria execution.
*
*
*/
public final class MyriaConstants {
/**
Expand Down Expand Up @@ -208,38 +208,76 @@ public final class MyriaConstants {
/**
* The relation that stores profiling information about which operators executed when.
*/
public static final RelationKey EVENT_PROFILING_RELATION = new RelationKey("public", "logs", "Profiling");
public static final RelationKey EVENT_PROFILING_RELATION =
new RelationKey("public", "logs", "Profiling");

/**
* The schema of the {@link #EVENT_PROFILING_RELATION}.
*/
public static final Schema EVENT_PROFILING_SCHEMA = Schema.ofFields("queryId", Type.LONG_TYPE, "subQueryId",
Type.INT_TYPE, "fragmentId", Type.INT_TYPE, "opId", Type.INT_TYPE, "startTime", Type.LONG_TYPE, "endTime",
Type.LONG_TYPE, "numTuples", Type.LONG_TYPE);
public static final Schema EVENT_PROFILING_SCHEMA =
Schema.ofFields(
"queryId",
Type.LONG_TYPE,
"subQueryId",
Type.INT_TYPE,
"fragmentId",
Type.INT_TYPE,
"opId",
Type.INT_TYPE,
"startTime",
Type.LONG_TYPE,
"endTime",
Type.LONG_TYPE,
"numTuples",
Type.LONG_TYPE);

/**
* The relation that stores profiling information about sent tuples.
*/
public static final RelationKey SENT_PROFILING_RELATION = new RelationKey("public", "logs", "Sending");
public static final RelationKey SENT_PROFILING_RELATION =
new RelationKey("public", "logs", "Sending");

/**
* The schema of the {@link #SENT_PROFILING_RELATION}.
*/
public static final Schema SENT_PROFILING_SCHEMA = Schema.ofFields("queryId", Type.LONG_TYPE, "subQueryId",
Type.INT_TYPE, "fragmentId", Type.INT_TYPE, "nanoTime", Type.LONG_TYPE, "numTuples", Type.LONG_TYPE,
"destWorkerId", Type.INT_TYPE);
public static final Schema SENT_PROFILING_SCHEMA =
Schema.ofFields(
"queryId",
Type.LONG_TYPE,
"subQueryId",
Type.INT_TYPE,
"fragmentId",
Type.INT_TYPE,
"nanoTime",
Type.LONG_TYPE,
"numTuples",
Type.LONG_TYPE,
"destWorkerId",
Type.INT_TYPE);

/**
* The relation that stores resource profiling information.
*/
public static final RelationKey RESOURCE_PROFILING_RELATION = new RelationKey("public", "logs", "Resource");
public static final RelationKey RESOURCE_PROFILING_RELATION =
new RelationKey("public", "logs", "Resource");

/**
* The schema of the {@link #RESOURCE_PROFILING_RELATION}.
*/
public static final Schema RESOURCE_PROFILING_SCHEMA = Schema.ofFields("timestamp", Type.LONG_TYPE, "opId",
Type.INT_TYPE, "measurement", Type.STRING_TYPE, "value", Type.LONG_TYPE, "queryId", Type.LONG_TYPE, "subqueryId",
Type.LONG_TYPE);
public static final Schema RESOURCE_PROFILING_SCHEMA =
Schema.ofFields(
"timestamp",
Type.LONG_TYPE,
"opId",
Type.INT_TYPE,
"measurement",
Type.STRING_TYPE,
"value",
Type.LONG_TYPE,
"queryId",
Type.LONG_TYPE,
"subqueryId",
Type.LONG_TYPE);

/**
* For how long cached versions of the profiling data should be valid.
Expand All @@ -255,17 +293,19 @@ public final class MyriaConstants {
/**
* Default imports for janino. Modules imported here can be used in expressions.
*/
public static final String[] DEFAULT_JANINO_IMPORTS =
{ "com.google.common.hash.Hashing", "java.nio.charset.Charset" };
public static final String[] DEFAULT_JANINO_IMPORTS = {
"com.google.common.hash.Hashing", "java.nio.charset.Charset"
};

/** Private constructor to disallow building utility class. */
private MyriaConstants() {
}
private MyriaConstants() {}

/** available fault-tolerance mode for each query in Myria. */
public static enum FTMode {
/** three FT modes are supported. */
NONE, ABANDON, REJOIN
NONE,
ABANDON,
REJOIN
};

/** available profiling mode for each query in Myria. */
Expand Down
17 changes: 10 additions & 7 deletions src/edu/washington/escience/myria/MyriaSystemConfigKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ public final class MyriaSystemConfigKeys {
/**
* This is a purely static class.
*/
private MyriaSystemConfigKeys() {
}
private MyriaSystemConfigKeys() {}

/**
* The max number of data messages that the {@link StreamInputBuffer} of each {@link Consumer} operator should hold.
* It's not a restrict upper bound. Different implementations of {@link StreamInputBuffer} may restrict the size
* differently. For example, a {@link FlowControlBagInputBuffer} use the upper bound as a soft restriction.
*/
public static final String OPERATOR_INPUT_BUFFER_CAPACITY = "operator.consumer.inputbuffer.capacity";
public static final String OPERATOR_INPUT_BUFFER_CAPACITY =
"operator.consumer.inputbuffer.capacity";

/**
* After an input buffer full event, if the size of the input buffer reduced to the recover_trigger, the input buffer
* recover event should be issued.
*/
public static final String OPERATOR_INPUT_BUFFER_RECOVER_TRIGGER = "operator.consumer.inputbuffer.recover.trigger";
public static final String OPERATOR_INPUT_BUFFER_RECOVER_TRIGGER =
"operator.consumer.inputbuffer.recover.trigger";

public static final String TCP_SEND_BUFFER_SIZE_BYTES = "tcp.sendbuffer.size.bytes";

Expand All @@ -37,12 +38,14 @@ private MyriaSystemConfigKeys() {
/**
* See {@link NioSocketChannelConfig#setWriteBufferLowWaterMark}.
*/
public static final String FLOW_CONTROL_WRITE_BUFFER_LOW_MARK_BYTES = "flowcontrol.writebuffer.watermark.low";
public static final String FLOW_CONTROL_WRITE_BUFFER_LOW_MARK_BYTES =
"flowcontrol.writebuffer.watermark.low";

/**
* See {@link NioSocketChannelConfig#setWriteBufferHighWaterMark}.
*/
public static final String FLOW_CONTROL_WRITE_BUFFER_HIGH_MARK_BYTES = "flowcontrol.writebuffer.watermark.high";
public static final String FLOW_CONTROL_WRITE_BUFFER_HIGH_MARK_BYTES =
"flowcontrol.writebuffer.watermark.high";

public static final String TCP_CONNECTION_TIMEOUT_MILLIS = "tcp.connection.timeout.milliseconds";

Expand Down Expand Up @@ -87,4 +90,4 @@ private MyriaSystemConfigKeys() {
public static final String GANGLIA_MASTER_PORT = "ganglia.master.port";

public static final String PERSIST_URI = "persist_uri";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* PostgresBinaryTupleWriter is a {@link TupleWriter} that serializes tuples to a a binary format that can be directly
* imported into PostgreSQL. See http://www.postgresql.org/docs/current/interactive/sql-copy.html.
*
*
* This requires integer time stamps.
*/
public class PostgresBinaryTupleWriter implements TupleWriter {
Expand Down Expand Up @@ -44,14 +44,13 @@ public void open(final OutputStream out) throws IOException {
* No-op
*/
@Override
public void writeColumnHeaders(final List<String> columnNames) throws IOException {
}
public void writeColumnHeaders(final List<String> columnNames) throws IOException {}

/**
* Converts the given java seconds to postgresql seconds. The conversion is valid for any year 100 BC onwards.
*
*
* from /org/postgresql/jdbc2/TimestampUtils.java
*
*
* @param seconds Postgresql seconds.
* @return Java seconds.
*/
Expand Down
Loading

0 comments on commit fb7ae5c

Please sign in to comment.