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

Reformat java code #122

Merged
merged 1 commit into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 14 additions & 7 deletions java/src/main/java/com/logicalclocks/hsfs/Feature.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,32 @@
@AllArgsConstructor
@NoArgsConstructor
public class Feature {
@Getter @Setter
@Getter
@Setter
private String name;

@Getter @Setter
@Getter
@Setter
private String type;

@Getter @Setter
@Getter
@Setter
private String onlineType;

@Getter @Setter
@Getter
@Setter
private String description;

@Getter @Setter
@Getter
@Setter
private Boolean primary;

@Getter @Setter
@Getter
@Setter
private Boolean partition;

@Getter @Setter
@Getter
@Setter
private String defaultValue;

public Feature(@NonNull String name) {
Expand Down
46 changes: 28 additions & 18 deletions java/src/main/java/com/logicalclocks/hsfs/FeatureGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,39 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class FeatureGroup extends FeatureGroupBase {

@Getter @Setter
@Getter
@Setter
private Boolean onlineEnabled;

@Getter @Setter
@Getter
@Setter
private String type = "cachedFeaturegroupDTO";

@Getter @Setter
@Getter
@Setter
private TimeTravelFormat timeTravelFormat = TimeTravelFormat.HUDI;

@Getter @Setter
@Getter
@Setter
protected String location;

@Getter @Setter
@Getter
@Setter
@JsonProperty("descStatsEnabled")
private Boolean statisticsEnabled;

@Getter @Setter
@Getter
@Setter
@JsonProperty("featHistEnabled")
private Boolean histograms;

@Getter @Setter
@Getter
@Setter
@JsonProperty("featCorrEnabled")
private Boolean correlations;

@Getter @Setter
@Getter
@Setter
private List<String> statisticColumns;

@JsonIgnore
Expand Down Expand Up @@ -113,11 +121,11 @@ public Dataset<Row> read(boolean online) throws FeatureStoreException, IOExcepti
return selectAll().read(online);
}

public Dataset<Row> read(Map<String,String> readOptions) throws FeatureStoreException, IOException {
public Dataset<Row> read(Map<String, String> readOptions) throws FeatureStoreException, IOException {
return read(false, null);
}

public Dataset<Row> read(boolean online, Map<String,String> readOptions) throws FeatureStoreException, IOException {
public Dataset<Row> read(boolean online, Map<String, String> readOptions) throws FeatureStoreException, IOException {
return selectAll().read(online, readOptions);
}

Expand All @@ -142,7 +150,7 @@ public Dataset<Row> read(String wallclockTime) throws FeatureStoreException, IOE
* @throws FeatureStoreException
* @throws IOException
*/
public Dataset<Row> read(String wallclockTime, Map<String,String> readOptions)
public Dataset<Row> read(String wallclockTime, Map<String, String> readOptions)
throws FeatureStoreException, IOException {
return selectAll().asOf(wallclockTime).read(false, readOptions);
}
Expand All @@ -151,7 +159,7 @@ public Dataset<Row> read(String wallclockTime, Map<String,String> readOptions)
* Reads changes that occurred between specified points in time.
*
* @param wallclockStartTime start date.
* @param wallclockEndTime end date.
* @param wallclockEndTime end date.
* @return DataFrame.
* @throws FeatureStoreException
* @throws IOException
Expand All @@ -165,12 +173,12 @@ public Dataset<Row> readChanges(String wallclockStartTime, String wallclockEndTi
* Reads changes that occurred between specified points in time.
*
* @param wallclockStartTime start date.
* @param wallclockEndTime end date.
* @param wallclockEndTime end date.
* @return DataFrame.
* @throws FeatureStoreException
* @throws IOException
*/
public Dataset<Row> readChanges(String wallclockStartTime, String wallclockEndTime, Map<String,String> readOptions)
public Dataset<Row> readChanges(String wallclockStartTime, String wallclockEndTime, Map<String, String> readOptions)
throws FeatureStoreException, IOException {
return selectAll().pullChanges(wallclockStartTime, wallclockEndTime).read(false, readOptions);
}
Expand Down Expand Up @@ -210,7 +218,7 @@ public void insert(Dataset<Row> featureData, boolean overwrite) throws IOExcepti

public void insert(Dataset<Row> featureData, Storage storage, boolean overwrite)
throws IOException, FeatureStoreException {
insert(featureData, storage, overwrite, null, null);
insert(featureData, storage, overwrite, null, null);
}

public void insert(Dataset<Row> featureData, boolean overwrite, Map<String, String> writeOptions)
Expand All @@ -222,7 +230,7 @@ public void insert(Dataset<Row> featureData, boolean overwrite, Map<String, Stri
* Commit insert or upsert to time travel enabled Feature group.
*
* @param featureData dataframe to be committed.
* @param operation commit operation type, INSERT or UPSERT.
* @param operation commit operation type, INSERT or UPSERT.
* @throws FeatureStoreException
* @throws IOException
*/
Expand Down Expand Up @@ -280,20 +288,22 @@ public void commitDeleteRecord(Dataset<Row> featureData, Map<String, String> wri

/**
* Return commit details.
*
* @throws FeatureStoreException
* @throws IOException
*/
public Map<String, Map<String,String>> commitDetails() throws IOException, FeatureStoreException {
public Map<String, Map<String, String>> commitDetails() throws IOException, FeatureStoreException {
return featureGroupEngine.commitDetails(this, null);
}

/**
* Return commit details.
*
* @param limit number of commits to return.
* @throws FeatureStoreException
* @throws IOException
*/
public Map<String, Map<String,String>> commitDetails(Integer limit) throws IOException, FeatureStoreException {
public Map<String, Map<String, String>> commitDetails(Integer limit) throws IOException, FeatureStoreException {
return featureGroupEngine.commitDetails(this, limit);
}

Expand Down
17 changes: 11 additions & 6 deletions java/src/main/java/com/logicalclocks/hsfs/FeatureGroupCommit.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class FeatureGroupCommit extends RestDto<FeatureGroupCommit> {
@Getter @Setter
public class FeatureGroupCommit extends RestDto<FeatureGroupCommit> {
@Getter
@Setter
private Long commitID;
@Getter @Setter
@Getter
@Setter
private String commitDateString;
@Getter @Setter
@Getter
@Setter
private Long rowsInserted;
@Getter @Setter
@Getter
@Setter
private Long rowsUpdated;
@Getter @Setter
@Getter
@Setter
private Long rowsDeleted;
}
17 changes: 10 additions & 7 deletions java/src/main/java/com/logicalclocks/hsfs/FeatureStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@

public class FeatureStore {

@Getter @Setter
@Getter
@Setter
@JsonProperty("featurestoreId")
private Integer id;

@Getter @Setter
@Getter
@Setter
@JsonProperty("featurestoreName")
private String name;

@Getter @Setter
@Getter
@Setter
private Integer projectId;

private FeatureGroupApi featureGroupApi;
Expand All @@ -61,7 +64,7 @@ public FeatureStore() throws FeatureStoreException {
/**
* Get a feature group object from the feature store.
*
* @param name the name of the feature group
* @param name the name of the feature group
* @param version the version of the feature group
* @return FeatureGroup
* @throws FeatureStoreException
Expand Down Expand Up @@ -89,7 +92,7 @@ public FeatureGroup getFeatureGroup(String name) throws FeatureStoreException, I
/**
* Get a on-demand feature group object from the feature store.
*
* @param name the name of the feature group
* @param name the name of the feature group
* @param version the version of the feature group
* @return OnDemandFeatureGroup
* @throws FeatureStoreException
Expand Down Expand Up @@ -141,11 +144,11 @@ public TrainingDataset.TrainingDatasetBuilder createTrainingDataset() {
return TrainingDataset.builder()
.featureStore(this);
}

/**
* Get a training dataset object from the selected feature store.
*
* @param name name of the training dataset
* @param name name of the training dataset
* @param version version to get
* @return TrainingDataset
* @throws FeatureStoreException
Expand Down
14 changes: 9 additions & 5 deletions java/src/main/java/com/logicalclocks/hsfs/FsQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,25 @@
@AllArgsConstructor
@NoArgsConstructor
public class FsQuery {
@Getter @Setter
@Getter
@Setter
private String query;

@Getter @Setter
@Getter
@Setter
private String queryOnline;

@Getter @Setter
@Getter
@Setter
private List<OnDemandFeatureGroupAlias> onDemandFeatureGroups;

@Getter @Setter
@Getter
@Setter
private List<HudiFeatureGroupAlias> hudiCachedFeatureGroups;

public void removeNewLines() {
query = query.replace("\n", " ");
queryOnline = queryOnline.replace("\n", " ");
queryOnline = queryOnline.replace("\n", " ");
}

public String getStorageQuery(Storage storage) throws FeatureStoreException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class HopsworksConnection implements Closeable {
public HopsworksConnection(String host, int port, String project, Region region, SecretStore secretStore,
boolean hostnameVerification, String trustStorePath,
String certPath, String apiKeyFilePath, String apiKeyValue)
throws IOException, FeatureStoreException {
throws IOException, FeatureStoreException {
this.host = host;
this.port = port;
this.project = project;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@
@NoArgsConstructor
public class HudiFeatureGroupAlias {

@Getter @Setter
@Getter
@Setter
private String alias;

@Getter @Setter
@Getter
@Setter
private FeatureGroup featureGroup;

@Getter @Setter
@Getter
@Setter
private Long leftFeatureGroupStartTimestamp;

@Getter @Setter
@Getter
@Setter
private Long leftFeatureGroupEndTimestamp;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class OnDemandFeatureGroup extends FeatureGroupBase {

@Getter @Setter
@Getter
@Setter
private StorageConnector storageConnector;

@Getter @Setter
@Getter
@Setter
private String query;

@Getter @Setter
@Getter
@Setter
private String type = "onDemandFeaturegroupDTO";

private OnDemandFeatureGroupEngine onDemandFeatureGroupEngine = new OnDemandFeatureGroupEngine();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
@NoArgsConstructor
public class OnDemandFeatureGroupAlias {

@Getter @Setter
@Getter
@Setter
private OnDemandFeatureGroup onDemandFeatureGroup;

@Getter @Setter
@Getter
@Setter
private String alias;
}
9 changes: 6 additions & 3 deletions java/src/main/java/com/logicalclocks/hsfs/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
@NoArgsConstructor
public class Project {

@Getter @Setter
@Getter
@Setter
private Integer projectId;
@Getter @Setter
@Getter
@Setter
private String projectName;
@Getter @Setter
@Getter
@Setter
private String owner;

public Project(Integer projectId) {
Expand Down
6 changes: 4 additions & 2 deletions java/src/main/java/com/logicalclocks/hsfs/Split.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
@AllArgsConstructor
@NoArgsConstructor
public class Split {
@Getter @Setter
@Getter
@Setter
private String name;

@Getter @Setter
@Getter
@Setter
private Float percentage;
}
Loading