You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/08/01 07:42:57 UTC

[incubator-streampipes] branch STREAMPIPES-563 updated: [STREAMPIPES-563] Remove old legacy code

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-563
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/STREAMPIPES-563 by this push:
     new afa03c300 [STREAMPIPES-563] Remove old legacy code
afa03c300 is described below

commit afa03c300f8990de347d6b82465e6d0b8571bf02
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Aug 1 09:42:38 2022 +0200

    [STREAMPIPES-563] Remove old legacy code
---
 .../dataexplorer/DataLakeNoUserManagementV3.java   |   4 +-
 .../apache/streampipes/ps/DataLakeResourceV3.java  | 198 +--------------------
 .../apache/streampipes/ps/DataLakeResourceV4.java  |  21 ---
 3 files changed, 5 insertions(+), 218 deletions(-)

diff --git a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataLakeNoUserManagementV3.java b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataLakeNoUserManagementV3.java
index 3f9c7bddb..2ae5c3dea 100644
--- a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataLakeNoUserManagementV3.java
+++ b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataLakeNoUserManagementV3.java
@@ -39,7 +39,9 @@ public class DataLakeNoUserManagementV3 {
         return false;
       }
     } else {
-      getDataLakeStorage().storeDataLakeMeasure(new DataLakeMeasure(measure, eventSchema));
+      DataLakeMeasure dataLakeMeasure = new DataLakeMeasure(measure, eventSchema);
+      dataLakeMeasure.setSchemaVersion(DataLakeMeasure.CURRENT_SCHEMA_VERSION);
+      getDataLakeStorage().storeDataLakeMeasure(dataLakeMeasure);
     }
     return true;
   }
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
index 900a8128d..6463d9428 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
@@ -32,40 +32,9 @@ import java.util.List;
 
 @Path("/v3/datalake")
 public class DataLakeResourceV3 extends AbstractRestResource {
-//  private DataLakeManagementV3 dataLakeManagement;
-//
   public DataLakeResourceV3() {
   }
-//
-//  public DataLakeResourceV3(DataLakeManagementV3 dataLakeManagement) {
-//    this.dataLakeManagement = dataLakeManagement;
-//  }
-//
-////  @GET
-////  @Produces(MediaType.APPLICATION_JSON)
-////  @GsonWithIds
-////  @Path("/data/{index}/paging")
-////  public Response getPage(@PathParam("index") String index,
-////                          @Context UriInfo info,
-////                          @QueryParam("itemsPerPage") int itemsPerPage) {
-////
-////    PageResult result;
-////    String page = info.getQueryParameters().getFirst("page");
-////
-////    try {
-////      if (page != null) {
-////        result = this.dataLakeManagement.getEvents(index, itemsPerPage, Integer.parseInt(page));
-////      } else {
-////        result = this.dataLakeManagement.getEvents(index, itemsPerPage);
-////      }
-////      return Response.ok(result).build();
-////    } catch (IOException e) {
-////      e.printStackTrace();
-////
-////      return Response.serverError().build();
-////    }
-////  }
-//
+
   @GET
   @JacksonSerialized
   @Produces(MediaType.APPLICATION_JSON)
@@ -74,168 +43,5 @@ public class DataLakeResourceV3 extends AbstractRestResource {
     List<DataLakeMeasure> result = DataExplorerUtils.getInfos();
     return ok(result);
   }
-//
-//  @Deprecated
-//  @GET
-//  @Produces(MediaType.APPLICATION_OCTET_STREAM)
-//  @Path("/data/{index}")
-//  public Response getAllData(@PathParam("index") String index,
-//                             @QueryParam("format") String format) {
-//    StreamingOutput streamingOutput = output -> dataLakeManagement.getAllEvents(index, format, output);
-//
-//    return Response.ok(streamingOutput, MediaType.APPLICATION_OCTET_STREAM).
-//            header("Content-Disposition", "attachment; filename=\"datalake." + format + "\"")
-//            .build();
-//  }
-//
-//  @GET
-//  @Produces(MediaType.APPLICATION_OCTET_STREAM)
-//  @Path("/data/{index}/download")
-//  public Response downloadData(@PathParam("index") String index,
-//                               @QueryParam("format") String format) {
-//    StreamingOutput streamingOutput = output -> dataLakeManagement.getAllEvents(index, format, output);
-//
-//    return Response.ok(streamingOutput, MediaType.APPLICATION_OCTET_STREAM).
-//            header("Content-Disposition", "attachment; filename=\"datalake." + format + "\"")
-//            .build();
-//  }
-//
-//  @GET
-//  @Produces(MediaType.APPLICATION_JSON)
-//  @Path("/data/{index}/last/{value}/{unit}")
-//  public Response getAllData(@PathParam("index") String index,
-//                             @PathParam("value") int value,
-//                             @PathParam("unit") String unit,
-//                             @Context UriInfo info) {
-//
-//
-//    String aggregationUnit = info.getQueryParameters().getFirst("aggregationUnit");
-//    String aggregationValue = info.getQueryParameters().getFirst("aggregationValue");
-//
-//    DataSeries result;
-//    try {
-//      if (aggregationUnit != null && aggregationValue != null) {
-//        result = dataLakeManagement.getEventsFromNow(index, unit, value, aggregationUnit,
-//                Integer.parseInt(aggregationValue));
-//      } else {
-//        result = dataLakeManagement.getEventsFromNowAutoAggregation(index, unit, value);
-//      }
-//      return Response.ok(result).build();
-//    } catch (RuntimeException e) {
-//      return constructErrorMessage(new Notification(e.getMessage(), ""));
-//    }
-//  }
-//
-//  @GET
-//  @Produces(MediaType.APPLICATION_JSON)
-//  @Path("/data/{index}/{startdate}/{enddate}")
-//  public Response getAllData(@Context UriInfo info,
-//                             @PathParam("index") String index,
-//                             @PathParam("startdate") long startdate,
-//                             @PathParam("enddate") long enddate) {
-//
-//    String aggregationUnit = info.getQueryParameters().getFirst("aggregationUnit");
-//    String aggregationValue = info.getQueryParameters().getFirst("aggregationValue");
-//
-//    DataSeries result;
-//
-//    try {
-//      if (aggregationUnit != null && aggregationValue != null) {
-//        result = dataLakeManagement.getEvents(index, startdate, enddate, aggregationUnit,
-//                Integer.parseInt(aggregationValue));
-//
-//      } else {
-//        result = dataLakeManagement.getEventsAutoAggregation(index, startdate, enddate);
-//      }
-//      return Response.ok(result).build();
-//    } catch (RuntimeException e) {
-//      return constructErrorMessage(new Notification(e.getMessage(), ""));
-//    }
-//  }
-//
-//  @GET
-//  @Produces(MediaType.APPLICATION_JSON)
-//  @Path("/data/{index}/{startdate}/{enddate}/grouping/{groupingTag}")
-//  public Response getAllDataGrouping(@Context UriInfo info,
-//                                     @PathParam("index") String index,
-//                                     @PathParam("startdate") long startdate,
-//                                     @PathParam("enddate") long enddate,
-//                                     @PathParam("groupingTag") String groupingTag) {
-//
-//    String aggregationUnit = info.getQueryParameters().getFirst("aggregationUnit");
-//    String aggregationValue = info.getQueryParameters().getFirst("aggregationValue");
-//
-//    SPQueryResult result;
-//    try {
-//      if (aggregationUnit != null && aggregationValue != null) {
-//        result = dataLakeManagement.getEvents(index, startdate, enddate, aggregationUnit,
-//                Integer.parseInt(aggregationValue), groupingTag);
-//      } else {
-//        result = dataLakeManagement.getEventsAutoAggregation(index, startdate, enddate, groupingTag);
-//      }
-//      return Response.ok(result).build();
-//    } catch (RuntimeException e) {
-//      return constructErrorMessage(new Notification(e.getMessage(), ""));
-//    }
-//  }
-//
-//  @DELETE
-//  @Produces(MediaType.APPLICATION_JSON)
-//  @Path("/data/delete/all")
-//  public Response removeAllData() {
-//
-//    boolean result = dataLakeManagement.removeAllDataFromDataLake();
-//
-//    return Response.ok(result).build();
-//  }
-//
-//  @GET
-//  @Produces(MediaType.APPLICATION_OCTET_STREAM)
-//  @Path("/data/{index}/{startdate}/{enddate}/download")
-//  public Response downloadData(@PathParam("index") String index, @QueryParam("format") String format,
-//                               @PathParam("startdate") long start, @PathParam("enddate") long end) {
-//    StreamingOutput streamingOutput = output -> dataLakeManagement.getAllEvents(index, format, start, end, output);
-//
-//    return Response.ok(streamingOutput, MediaType.APPLICATION_OCTET_STREAM).
-//            header("Content-Disposition", "attachment; filename=\"datalake." + format + "\"")
-//            .build();
-//  }
-//
-//  @GET
-//  @Path("/data/image/{route}/file")
-//  @Produces("image/png")
-//  public Response getImage(@PathParam("route") String fileRoute) throws IOException {
-//    return ok(dataLakeManagement.getImage(fileRoute));
-//  }
-//
-//  @POST
-//  @Path("/data/image/{route}/coco")
-//  public void saveImageCoco(@PathParam("route") String fileRoute, String data) throws IOException {
-//    dataLakeManagement.saveImageCoco(fileRoute, data);
-//  }
-//
-//  @GET
-//  @Path("/data/image/{route}/coco")
-//  @Produces("application/json")
-//  public Response getImageCoco(@PathParam("route") String fileRoute) throws IOException {
-//    return ok(dataLakeManagement.getImageCoco(fileRoute));
-//  }
-//
-//  @POST
-//  @Produces(MediaType.TEXT_PLAIN)
-//  @Path("/data/{index}/{startdate}/{enddate}/labeling/{column}/{timestampColumn}")
-//  public Response labelData(@Context UriInfo info,
-//                            @PathParam("index") String index,
-//                            @PathParam("startdate") long startdate,
-//                            @PathParam("enddate") long enddate,
-//                            @PathParam("column") String column,
-//                            @PathParam("timestampColumn") String timestampColumn) {
-//
-//    String label = info.getQueryParameters().getFirst("label");
-//    this.dataLakeManagement.updateLabels(index, column, startdate, enddate, label, timestampColumn);
-//
-//    return Response.ok("Successfully updated database.", MediaType.TEXT_PLAIN).build();
-//  }
-//
-//
+
 }
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
index b98cde8bc..fcd1e6ea9 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
@@ -43,10 +43,6 @@ import java.util.Map;
 
 import static org.apache.streampipes.dataexplorer.v4.SupportedDataLakeQueryParameters.*;
 
-class Placeholder {
-}
-
-
 @Path("v4/datalake")
 public class DataLakeResourceV4 extends AbstractRestResource {
 
@@ -219,23 +215,6 @@ public class DataLakeResourceV4 extends AbstractRestResource {
         return ok(this.dataLakeManagement.getDataLakeConfiguration());
     }
 
-    @POST
-    @Path("/measurements/{measurementID}/labeling")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Operation(summary = "Label data points of the measurement series with given id", tags = {"Data Lake"},
-            responses = {
-                    @ApiResponse(responseCode = "200", description = "Labeling was successful")})
-    public Response labelData(@Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID
-            , @Parameter(in = ParameterIn.DEFAULT, description = "the label details that should be written into database") Placeholder body
-
-            , @Parameter(in = ParameterIn.QUERY, description = "start date for slicing operation") @QueryParam("startDate") String startDate
-            , @Parameter(in = ParameterIn.QUERY, description = "end date for slicing operation") @QueryParam("endDate") String endDate) {
-        /**
-         * TODO: implementation of method stump
-         */
-        return null;
-    }
-
     @DELETE
     @Path("/measurements")
     @Operation(summary = "Remove all stored measurement series from Data Lake", tags = {"Data Lake"},