Skip to content

Commit

Permalink
removal of unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvihladremio committed Nov 2, 2023
1 parent 6a3f9c3 commit e098337
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,10 @@ public interface DremioApi {
* runs a sql statement against the rest API
*
* @param sql sql string to submit to dremio
* @param context conext list to use with the query
* @param contexts sql context to use with the query
* @return the result of the job
* @throws IOException occurs when the underlying apiCall does, typically a problem with handling
* of the body
*/
DremioApiResponse runSQL(String sql, Collection<String> table) throws IOException;

/**
* The http URL for the dremio server
*
* @return return the url used to access Dremio
*/
String getUrl();
DremioApiResponse runSQL(String sql, Collection<String> contexts) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,4 @@ public DremioApiResponse runSQL(String sql, Collection<String> table) throws IOE
throw new RuntimeException(e);
}
}

/**
* The http URL for the dremio server
*
* @return return the url used to access Dremio
*/
@Override
public String getUrl() {
return "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,4 @@ public DremioApiResponse runSQL(String sql, Collection<String> contexts) throws
return failed;
}
}

/** @return return the url used to access Dremio */
@Override
public String getUrl() {
return this.baseUrl;
}
}
32 changes: 0 additions & 32 deletions src/main/java/com/dremio/support/diagnostics/stress/FileMaker.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ public class HttpApiResponse {
private String message;
private Map<String, Object> response;

public int getResponseCode() {
return responseCode;
}

public void setResponseCode(int responseCode) {
this.responseCode = responseCode;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}
Expand Down
64 changes: 0 additions & 64 deletions src/main/java/com/dremio/support/diagnostics/stress/Human.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package com.dremio.support.diagnostics.stress;

import java.text.NumberFormat;

/**
* Provides utility methods for making more easily understandable the output of big numbers
* typically bytes and time units
Expand All @@ -33,16 +31,9 @@ public class Human {
/** a day measured in milliseconds */
private static final long DAY = 24 * HOUR;

private static final long kb = 1024L;
private static final double kbd = 1024.0;

/** prevent instantiation */
private Human() {}

public static String getHumanDurationFromNanos(final long durationNanos) {
return getHumanDurationFromMillis(durationNanos / 1_000_000);
}

/**
* Convert into a string the appropriate time unit for a time span measured in milliseconds. The
* maximum unit of measure is days and the minimum is in milliseconds.
Expand Down Expand Up @@ -82,59 +73,4 @@ public static String getHumanDurationFromMillis(final long durationMillis) {
}
return String.format("%s milliseconds", durationMillis);
}

/**
* Convert bytes into a string measurement of terabytes, gigabytes, megabytes, kilobytes or bytes.
* Appropriate for RAM, but some would argue not for disk size or network bandwidth. For file size
* this is largely a matter of preference
*
* @see <a href="https://wiki.ubuntu.com/UnitsPolicy">Ubuntu Units Policy</a>
* @param bytes number of bytes
* @return formatted string with decimal precision of 2, the largest unit of measure will be
* terabytes
*/
public static String getHumanBytes1024(final long bytes) {

if (bytes > kb * kb * kb * kb) {
return String.format("%.2f tb", bytes / (kb * kb * kb * kbd));
}
if (bytes > kb * kb * kb) {
return String.format("%.2f gb", bytes / (kb * kb * kbd));
}
if (bytes > kb * kb) {
return String.format("%.2f mb", bytes / (kb * kbd));
}
if (bytes > kb) {
return String.format("%.2f kb", bytes / kbd);
}
return String.format("%s bytes", bytes);
}

public static String getHumanNumber(final long number) {
return NumberFormat.getInstance().format(number);
}

public static String getHumanNumber(final double number) {
final NumberFormat format = NumberFormat.getInstance();
format.setMaximumFractionDigits(2);
return format.format(number);
}

public static String getHumanBytes1000(final long bytes) {
long kb = 1000;
double kbd = 1000.0;
if (bytes > kb * kb * kb * kb) {
return String.format("%.2f tb", bytes / (kb * kb * kb * kbd));
}
if (bytes > kb * kb * kb) {
return String.format("%.2f gb", bytes / (kb * kb * kbd));
}
if (bytes > kb * kb) {
return String.format("%.2f mb", bytes / (kb * kbd));
}
if (bytes > kb) {
return String.format("%.2f kb", bytes / kbd);
}
return String.format("%s bytes", bytes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.Map;

public class QueryConfig {

private String query;
private String queryGroup;
private int frequency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;

public class StressConfig {

private List<QueryConfig> queries;
private List<QueryGroup> queryGroups;

Expand Down

0 comments on commit e098337

Please sign in to comment.