geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vfor...@apache.org
Subject [06/15] incubator-geode git commit: GEODE-341: Refactor Java packages to reflect Apache organization. - Root package changed to "org.apache.geode.jvsd". - pom.xml changed to use "org.apache.geode" as the groupId.
Date Wed, 13 Jan 2016 17:14:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
deleted file mode 100644
index cc77ceb..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.controller;
-
-import com.pivotal.jvsd.fx.ChartManager;
-import com.pivotal.jvsd.fx.Main;
-import com.pivotal.jvsd.fx.StatFileManager;
-import com.pivotal.jvsd.model.ResourceWrapper;
-import com.pivotal.jvsd.model.stats.StatArchiveFile;
-import com.pivotal.jvsd.model.stats.StatArchiveFile.StatValue;
-import java.io.File;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.fxml.FXML;
-import javafx.fxml.Initializable;
-import javafx.scene.control.Button;
-import javafx.scene.control.ComboBox;
-import javafx.scene.control.ListView;
-import javafx.scene.control.SelectionMode;
-import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableView;
-import javafx.scene.control.cell.PropertyValueFactory;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javafx.event.ActionEvent;
-import javafx.scene.control.MenuItem;
-import javafx.stage.FileChooser;
-
-/**
- * @author Jens Deppe
- */
-public class RootController implements Initializable {
-
-  @FXML
-  private TableView<ResourceWrapper> tableView;
-
-  @FXML
-  private ListView listView;
-
-  @FXML
-  private Button newChartButton;
-
-  @FXML
-  private Button addToChartButton;
-
-  @FXML
-  private ComboBox chartCombo;
-
-  private ObservableList<Integer> chartList;
-
-  private ObservableList<ResourceWrapper> resources;
-
-  private ObservableList statNames;
-
-  private StatFileManager fileManager = StatFileManager.getInstance();
-
-  private ChartManager chartManager = ChartManager.getInstance();
-
-  @Override
-  public void initialize(URL url, ResourceBundle resourceBundle) {
-    double[] columnPercent = {
-        0.05,  // Row
-        0.25,  // Start Time
-        0.05,  // File
-        0.075, // Samples
-        0.075, // PID
-        0.2,   // Type
-        0.3    // Name
-    };
-
-    ObservableList<TableColumn<ResourceWrapper, ?>> cols = tableView.getColumns();
-    // Set column widths
-    for (int i = 0; i < 7; i++) {
-      cols.get(i).prefWidthProperty().
-          bind(tableView.widthProperty().multiply(columnPercent[i]));
-    }
-
-    cols.get(0).setCellValueFactory(new PropertyValueFactory<>("row"));
-    cols.get(1).setCellValueFactory(new PropertyValueFactory<>("startTime"));
-    cols.get(2).setCellValueFactory(new PropertyValueFactory<>("file"));
-    cols.get(3).setCellValueFactory(new PropertyValueFactory<>("samples"));
-    cols.get(4).setCellValueFactory(new PropertyValueFactory<>("pid"));
-    cols.get(5).setCellValueFactory(new PropertyValueFactory<>("type"));
-    cols.get(6).setCellValueFactory(new PropertyValueFactory<>("name"));
-
-    resources = FXCollections.observableArrayList();
-
-        updateArchives();
-
-    tableView.setItems(resources);
-    tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
-    tableView.getSelectionModel().selectedItemProperty().addListener(
-        (observableValue, oldValue, newValue) -> {
-          updateStatList();
-        });
-
-    statNames = FXCollections.observableArrayList();
-    listView.setItems(statNames);
-    listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
-    listView.getSelectionModel().selectedItemProperty().addListener(
-        (observableValue, oldValue, newValue) -> {
-          System.out.println(newValue);
-        });
-
-    chartList = FXCollections.observableArrayList();
-    chartCombo.setItems(chartList);
-  }
-
-    private void updateArchives() {
-        int row = 0;
-        for (StatArchiveFile s : fileManager.getArchives()) {
-            for (StatArchiveFile.ResourceInst r : s.getResourceInstList()) {
-                resources.add(new ResourceWrapper(r, row++));
-            }
-        }
-    }
-
-  private List<StatValue> getSelectedStatValues() {
-    List<StatValue> result = new ArrayList<>();
-
-    List<String> statNames = listView.getSelectionModel().getSelectedItems();
-    ObservableList<ResourceWrapper> rows =
-        tableView.getSelectionModel().getSelectedItems();
-    if (rows != null && rows.size() > 0) {
-      for (ResourceWrapper r : rows) {
-        for (String stat : statNames) {
-          StatValue sv = r.getStatValue(stat);
-          result.add(sv);
-        }
-      }
-    }
-
-    return result;
-  }
-
-  @FXML
-  private void newChartButtonClicked() {
-    List<StatValue> svs = getSelectedStatValues();
-    if (svs.size() > 0) {
-      try {
-        int id = chartManager.newChart(svs.get(0));
-        svs.remove(0);
-        for (StatValue s : svs) {
-          chartManager.addToChart(id, s);
-        }
-        chartCombo.getSelectionModel().select(id);
-      } catch (IOException iox) {
-        iox.printStackTrace();
-      }
-    }
-  }
-
-  @FXML
-  private void addToChartButtonClicked() {
-    Integer i = (Integer) chartCombo.getSelectionModel().getSelectedItem();
-    List<StatValue> svs = getSelectedStatValues();
-    try {
-      for (StatValue s : svs) {
-        chartManager.addToChart(i, s);
-      }
-    } catch (IOException iox) {
-      iox.printStackTrace();
-    }
-  }
-
-  @FXML
-  private void handleOpenMenuAction(ActionEvent e){
-      try {
-          FileChooser fileChooser = new FileChooser();
-          fileChooser.setTitle("Open Statistics File");
-          File file=fileChooser.showOpenDialog(null);
-          StatFileManager.getInstance().add(file.getCanonicalPath());
-          updateArchives();
-      } catch (IOException ex) {
-          //TODO needs warning dialog of failed file open.
-      }
-  }
-  
-  @FXML
-  private void handleCloseMenuAction(ActionEvent e){
-    //TODO do a real clean up and shutdown   
-    //just kill it now
-      System.exit(0);
-  }
-  
-  public void setChartList(Collection<Integer> chartList) {
-    if (chartList.size() > 0) {
-      chartCombo.setDisable(false);
-      this.chartList.clear();
-      this.chartList.addAll(chartList);
-      this.chartCombo.getSelectionModel().select(0);
-      addToChartButton.setDisable(false);
-    } else {
-      this.chartList.clear();
-      chartCombo.setDisable(true);
-      addToChartButton.setDisable(true);
-    }
-
-  }
-
-  private void updateStatList() {
-    ObservableList<ResourceWrapper> rows =
-        tableView.getSelectionModel().getSelectedItems();
-    List<String> tmpStatNames = rows.get(0).getStatNames();
-
-    for (int i = 1; i < rows.size(); i++) {
-      List<String> tmpNames = rows.get(i).getStatNames();
-      Iterator<String> it = tmpStatNames.iterator();
-      while (it.hasNext()) {
-        String s = it.next();
-        if (!tmpNames.contains(s)) {
-          it.remove();
-        }
-      }
-    }
-
-    statNames.clear();
-    statNames.addAll(tmpStatNames);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ChartManager.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ChartManager.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ChartManager.java
deleted file mode 100644
index 4cf71a1..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ChartManager.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import com.pivotal.jvsd.controller.RootController;
-import com.pivotal.jvsd.model.stats.StatArchiveFile;
-import javafx.fxml.FXMLLoader;
-import javafx.scene.Scene;
-import javafx.scene.layout.Pane;
-import javafx.stage.Stage;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Basic container for all charts which are currently being displayed
- *
- * @author Jens Deppe
- */
-public class ChartManager {
-
-  static final boolean MMTEST = true;
-
-  private Map<Integer, VSDChartWindow> charts = new HashMap<>();
-
-  private static ChartManager instance = new ChartManager();
-
-  private RootController root;
-
-  private int chartId = 0;
-
-  private ChartManager() {
-    // We are a singleton
-  }
-
-  public static ChartManager getInstance() {
-    return instance;
-  }
-
-  public VSDChartWindow add(VSDChartWindow chart) {
-    return chart;
-  }
-
-  public VSDChartWindow get(String chartName) {
-    return charts.get(chartName);
-  }
-
-  public void setRootController(RootController root) {
-    this.root = root;
-  }
-
-  public void removeChart(int id) {
-    charts.remove(id);
-    root.setChartList(charts.keySet());
-  }
-
-  public int newChart(StatArchiveFile.StatValue sv) throws IOException {
-    int id = chartId++;
-
-    FXMLLoader loader = new FXMLLoader(getClass().getResource("/chart.fxml"));
-    Pane chartPane = loader.load();
-    Stage stage = new Stage();
-    Scene scene = new Scene(chartPane);
-    scene.getStylesheets().add("META-INF/css/style.css");
-    stage.setScene(scene);
-    stage.show();
-
-    VSDChartWindow controller = loader.getController();
-    controller.setId(id);
-    charts.put(id, controller);
-    root.setChartList(charts.keySet());
-
-    controller.setStage(stage);
-//    if (!MMTEST) {
-      controller.addToChart(sv);
-//    }
-
-    return id;
-  }
-
-  public void addToChart(int id, StatArchiveFile.StatValue sv) throws IOException {
-    charts.get(id).addToChart(sv);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
deleted file mode 100644
index eed7076..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import javafx.scene.Cursor;
-import javafx.scene.control.Label;
-import javafx.scene.layout.StackPane;
-
-public class HoveredThresholdNode extends StackPane {
-  public HoveredThresholdNode(String labelString) {
-    setPrefSize(2, 2);
-
-    final Label label = createDataThresholdLabel(labelString);
-
-    setOnMouseEntered(mouseEvent -> {
-      getChildren().setAll(label);
-      setCursor(Cursor.NONE);
-      toFront();
-    });
-    setOnMouseExited(mouseEvent -> {
-      getChildren().clear();
-      setCursor(Cursor.CROSSHAIR);
-    });
-  }
-
-  private Label createDataThresholdLabel(String labelString) {
-    final Label label = new Label(labelString);
-    // TODO style, colors, etc.
-    label.getStyleClass().addAll("chart-line-symbol", "chart-series-line");
-    label.setStyle("-fx-font-size: 8pt;");
-
-    label.setMinSize(Label.USE_PREF_SIZE, Label.USE_PREF_SIZE);
-    return label;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
deleted file mode 100644
index 132650b..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import java.nio.ByteBuffer;
-
-import com.pivotal.javafx.scene.chart.ByteBufferNumberSeries;
-import com.pivotal.javafx.scene.chart.Data;
-
-import javafx.collections.ObservableList;
-
-/**
- * A named series of data items
- */
-public class LongDoubleMemoryMappedSeries extends ByteBufferNumberSeries<Number, Number>
{
-
-  // -------------- CONSTRUCTORS ----------------------------------------------
-
-  /**
-   * Construct a empty series
-   */
-  public LongDoubleMemoryMappedSeries() {
-    super();
-  }
-
-  /**
-   * Constructs a Series and populates it with the given {@link ObservableList}
-   * data.
-   *
-   * @param data
-   *          ObservableList of MultiAxisChart.Data
-   */
-  public LongDoubleMemoryMappedSeries(ByteBuffer buffer) {
-    super(buffer);
-  }
-
-  /**
-   * Constructs a named Series and populates it with the given
-   * {@link ObservableList} data.
-   *
-   * @param name
-   *          a name for the series
-   * @param data
-   *          ObservableList of MultiAxisChart.Data
-   */
-  public LongDoubleMemoryMappedSeries(String name, ByteBuffer buffer) {
-    super(name, buffer);
-  }
-
-  // BEGIN FORMAT SPECIFIC
-  private static final int DATA_X_OFFSET = 0;
-  private static final int DATA_X_LENGTH = 8;
-  private static final int DATA_Y_OFFSET = DATA_X_OFFSET + DATA_X_LENGTH;
-  private static final int DATA_Y_LENGTH = 8;
-  private static final int DATA_WIDTH = DATA_Y_OFFSET + DATA_Y_LENGTH;
-  
-  // TODO Make these Abstract
-  @Override
-  public int getDataSize() {
-    return getBuffer().limit() / DATA_WIDTH;
-  }
-  
-  // TODO Make these Abstract
-  private long getXRaw(final int index) {
-    return buffer.getLong(index * DATA_WIDTH + DATA_X_OFFSET);
-  }
-
-  // TODO Make these Abstract
-  private double getYRaw(final int index) {
-    return buffer.getDouble(index * DATA_WIDTH + DATA_Y_OFFSET);
-  }
-
-  // END FORMAT SPECIFIC
- 
-  @Override
-  final protected Data<Number,Number> createData(int index) {
-    return new Data<>(getXRaw(index), getYRaw(index));
-  };
-    
-  @Override
-  final protected Long convertX(final double x) {
-    return (long) x;
-  }
-  
-  @Override
-  final protected Double convertY(final double y) {
-    return y;
-  }
-
-  @Override
-  final protected double getX(final int index) {
-    return (double) getXRaw(index);
-  };
-
-  @Override
-  final protected double getY(final int index) {
-    return (double) getYRaw(index);
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
deleted file mode 100644
index 84eef0f..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import com.pivotal.jvsd.controller.RootController;
-import javafx.application.Application;
-import javafx.fxml.FXMLLoader;
-import javafx.scene.Scene;
-import javafx.scene.layout.Pane;
-import javafx.stage.Stage;
-
-import java.io.IOException;
-
-/**
- * @author Jens Deppe
- */
-public class Main extends Application {
-
-  private Stage primaryStage;
-
-  private RootController controller;
-
-  @Override
-  public void start(Stage stage) throws IOException {
-    primaryStage = stage;
-    primaryStage.setTitle("jVSD");
-
-    FXMLLoader loader = new FXMLLoader(getClass().getResource("/jvsd.fxml"));
-    Pane rootLayout = loader.load();
-
-    Scene scene = new Scene(rootLayout);
-    scene.getStylesheets().add("/jvsd.css");
-
-    controller = loader.getController();
-
-    ChartManager.getInstance().setRootController(controller);
-
-    primaryStage.setScene(scene);
-    primaryStage.show();
-  }
-
-  public static void main(String[] args) throws IOException {
-    StatFileManager.getInstance().add(args);
-    launch(args);
-  } 
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
deleted file mode 100644
index 4f48894..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-public class ObservableByteBuffer {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
deleted file mode 100644
index dc87cb1..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import java.nio.ByteBuffer;
-import java.util.Observer;
-
-import com.pivotal.javafx.scene.chart.Data;
-
-import javafx.collections.ObservableListBase;
-
-public class ObservableDataBuffer<X, Y> extends ObservableListBase<Data<X, Y>>
{
-
-  @Override
-  public Data<X, Y> get(int index) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-  
-  @Override
-  public boolean add(Data<X, Y> e) {
-    
-    
-    return true;
-  }
-
-  @Override
-  public int size() {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
deleted file mode 100644
index a0175a3..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import com.pivotal.jvsd.model.stats.StatArchiveFile;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Basic container for all stat files we are managing.
- *
- * @author Jens Deppe
- */
-public class StatFileManager {
-
-  private List<StatArchiveFile> statFiles = new ArrayList<>();
-
-  private static StatFileManager instance = new StatFileManager();
-
-  private StatFileManager() {
-    // We are a singleton
-  }
-
-  public static StatFileManager getInstance() {
-    return instance;
-  }
-
-  public void add(String[] fileNames) throws IOException {
-    for (String name : fileNames) {
-      statFiles.add(new StatArchiveFile(name));
-    }
-  }
-  
-  public void add(String fileName) throws IOException {
-      statFiles.add(new StatArchiveFile(fileName));
-  }
-
-  public List<StatArchiveFile> getArchives() {
-    return statFiles;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
deleted file mode 100644
index 114d39f..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import java.io.File;
-
-import javafx.scene.Group;
-import javafx.scene.Scene;
-import javafx.stage.Stage;
-import javafx.animation.Animation;
-import javafx.animation.KeyFrame;
-import javafx.animation.Timeline;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.scene.chart.LineChart;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.util.Duration;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.net.URL;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.text.DateFormat;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-import java.util.ResourceBundle;
-
-import javafx.beans.binding.Bindings;
-import javafx.collections.FXCollections;
-import javafx.fxml.FXML;
-import javafx.fxml.Initializable;
-import javafx.geometry.Side;
-import javafx.scene.chart.Axis;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.control.Button;
-import javafx.scene.control.Label;
-import javafx.scene.layout.Pane;
-import javafx.stage.Stage;
-
-import com.pivotal.chart.AdvancedLineChart;
-import com.pivotal.javafx.scene.chart.BasicSeries;
-import com.pivotal.javafx.scene.chart.Data;
-import com.pivotal.javafx.scene.chart.DateAxis;
-import com.pivotal.jvsd.model.stats.StatArchiveFile.StatValue;
-import com.pivotal.jvsd.stats.Utility;
-
-/**
- * An advanced line chart with a variety of actions and settable properties.
- *
- * @see javafx.scene.chart.LineChart
- * @see javafx.scene.chart.Chart
- * @see javafx.scene.chart.NumberAxis
- * @see javafx.scene.chart.XYChart
- */
-public class VSDChartWindow implements Initializable {
-
-  private int chartId;
-
-  private Stage stage;
-
-  private AdvancedLineChart<Number, Number> chart;
-
-  private ChartManager manager = ChartManager.getInstance();
-
-  @FXML
-  private Pane root;
-
-  @FXML
-  private Button resetButton;
-
-  @FXML
-  private Label coordLabel;
-
-  public void setStage(Stage stage) {
-    this.stage = stage;
-    this.stage.setOnCloseRequest(eh -> {
-      manager.removeChart(chartId);
-    });
-  }
-
-  public void setId(int chartId) {
-    this.chartId = chartId;
-  }
-
-  @Override
-  public void initialize(URL url, ResourceBundle resourceBundle) {
-    chart = createChart(root);
-    root.getChildren().add(chart);
-
-    // TODO better way to do this?
-    coordLabel.textProperty().bind(Bindings.format("%s x %s",
-        Bindings.createStringBinding(() -> DateFormat.getInstance().format(
-                chart.getXAxis().getValueForDisplay(
-                    chart.crosshairXProperty().doubleValue())),
-            chart.crosshairXProperty()),
-        Bindings.createStringBinding(() -> {
-          final NumberFormat formatter = NumberFormat.getInstance();
-          formatter.setGroupingUsed(true);
-          return formatter.format(
-              chart.getPrimaryYAxis().getValueForDisplay(
-                  chart.crosshairYProperty().doubleValue()));
-        }, chart.crosshairYProperty(), chart.primaryYAxisProperty())));
-  }
-
-  @FXML
-  private void resetRangeClicked() {
-    chart.getXAxis().setAutoRanging(true);
-    for (Axis<Number> yAxis : chart.getYAxes()) {
-      yAxis.setAutoRanging(true);
-    }
-  }
-
-  protected AdvancedLineChart<Number, Number> createChart(Pane root) {
-    final DateAxis xAxis = new DateAxis();
-    xAxis.setAutoRanging(true);
-    final NumberAxis yAxis = new NumberAxis();
-    final AdvancedLineChart<Number, Number> lc =
-        new AdvancedLineChart<>(xAxis, yAxis);
-    lc.setCreateSymbols(false);
-    lc.prefWidthProperty().bind(root.widthProperty());
-    lc.prefHeightProperty().bind(root.heightProperty());
-
-    if (ChartManager.MMTEST) {
-//    
-//    try (final RandomAccessFile memoryMappedFile = new RandomAccessFile("/tmp/test.vsd.stat1.vss",
"rw")) {
-//
-//      final MappedByteBuffer in = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_ONLY,
0, memoryMappedFile.length());
-////      in.limit(1000000);
-//      final LongDoubleMemoryMappedSeries s = new LongDoubleMemoryMappedSeries(in);
-//      lc.getData().add(s);
-//
-////      Timeline animation = new Timeline();
-////      animation.getKeyFrames().add(new KeyFrame(Duration.seconds(1), actionEvent ->
{
-////          in.limit(in.limit()+16);
-////          System.out.println(in.limit());
-//////          lc.toFront();
-//////          Data<Number, Number> last = s.getData().get(s.getData().size() - 1);
-//////          s.getData().add(new Data<>(last.getXValue().longValue() + 1000, last.getYValue().doubleValue()
+ (new Random().nextDouble() * 1000) - 500));
-////        
-////      }));
-////     animation.setCycleCount(Animation.INDEFINITE);
-////     animation.play();
-//      
-//
-//    } catch (FileNotFoundException e) {
-//      // TODO Auto-generated catch block
-//      e.printStackTrace();
-//    } catch (IOException e) {
-//      // TODO Auto-generated catch block
-//      e.printStackTrace();
-//    }
-    
-    }
-
-//  lc.getData().add(new LongDoubleFileSeries(new File("/tmp/test.vsd.stat1.vss")));
-
-    return lc;
-  }
-
-  public void addToChart(StatValue sv) {
-    if (!stage.titleProperty().isBound()) {
-      stage.setTitle(
-          "Chart" + chartId + "_" + sv.getDescriptor().getName());
-    }
-
-    Axis<Number> yAxis;
-    final String units = sv.getDescriptor().getUnits();
-    yAxis = findOrCreateYAxis(units);
-
-    final long[] timestamps = sv.getRawAbsoluteTimeStamps();
-    final double[] values = sv.getRawSnapshots();
-
-    long timeSampleAverage = Utility.computeTimeSampleAverage(timestamps);
-    long samplePeriod = timeSampleAverage / 1000;
-
-    final List<Data<Number, Number>> data; 
-    switch (sv.getFilter()) {
-    case StatValue.FILTER_NONE:
-      data = doFilterNone(samplePeriod, timestamps, values);
-      break;
-    case StatValue.FILTER_PERSEC:
-      data = doFilterPerSec(samplePeriod, timestamps, values);
-      break;
-    default:
-      data = null;
-    }
-
-    // add series data
-    if (ChartManager.MMTEST) {
-      addToChartMM(sv, yAxis, data);
-    } else {
-      BasicSeries<Number, Number> series = new BasicSeries<>(FXCollections.observableList(data));
-      series.setYAxis(yAxis);
-      series.setName(sv.getDescriptor().getName());
-      chart.getData().add(series);
-    }
-  }
-
-  private void addToChartMM(StatValue sv, Axis<Number> yAxis, List<Data<Number,
Number>> data) {
-    try {
-      final File tmp = File.createTempFile(sv.getDescriptor().getName(), ".vss");
-      tmp.deleteOnExit();
-      
-      try (final RandomAccessFile memoryMappedFile = new RandomAccessFile(tmp, "rw")) {
-        final MappedByteBuffer out = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_WRITE,
0, data.size() * 16);
-
-        for (Data<Number, Number> d : data) {
-          out.putLong(d.getXValue().longValue());
-          out.putDouble(d.getYValue().doubleValue());
-        }
-        out.force();
-
-        final LongDoubleMemoryMappedSeries s = new LongDoubleMemoryMappedSeries(out);
-        s.setYAxis(yAxis);
-        s.setName(sv.getDescriptor().getName());
-        chart.getData().add(s);
-      }
-    } catch (IOException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-  }
-
-  protected List<Data<Number, Number>> doFilterNone(long samplePeriod, final
long[] timestamps, final double[] values) {
-    final ArrayList<Data<Number, Number>> list = new ArrayList<>(timestamps.length
- 1);
-    final NumberFormat numberFormat = NumberFormat.getInstance();
-    
-    // skip first value to calc value/s.
-    for (int i = 1; i < timestamps.length; i++) {
-      final Data<Number, Number> data = new Data<Number, Number>(timestamps[i],
values[i]);
-
-//TODO speed up      data.setNode(new HoveredThresholdNode(numberFormat.format(values[i])));
-      list.add(data);
-    }
-    
-    return list;
-  }
-
-  protected List<Data<Number, Number>> doFilterPerSec(long samplePeriod, final
long[] timestamps, final double[] values) {
-    final ArrayList<Data<Number, Number>> list = new ArrayList<>(timestamps.length
- 1);
-    final NumberFormat numberFormat = NumberFormat.getInstance();
-    
-    // skip first value to calc value/s.
-    for (int i = 1; i < timestamps.length; i++) {
-      final long timestamp = timestamps[i];
-      final double psValue = Utility.computePerSecondValue(timestamp, timestamps[i - 1],
values[i], values[i - 1], samplePeriod);
-      final Data<Number, Number> data = new Data<Number, Number>(timestamp, psValue);
-
-//TODO speed up      data.setNode(new HoveredThresholdNode(numberFormat.format(psValue)));
-      list.add(data);
-    }
-    
-    return list;
-  }
-
-  private Axis<Number> findOrCreateYAxis(final String units) {
-    Axis<Number> yAxis = findYAxis(units);
-
-    if (null == yAxis) {
-      yAxis = new NumberAxis();
-      yAxis.setSide(Side.RIGHT);
-      chart.getYAxes().add(yAxis);
-    }
-
-    if (null == yAxis.getLabel()) {
-      yAxis.setLabel(units);
-    }
-
-    return yAxis;
-  }
-
-  private Axis<Number> findYAxis(final String units) {
-    for (Axis<Number> y : chart.getYAxes()) {
-      if (null == y.getLabel() || y.getLabel().equals(units)) {
-        return y;
-      }
-    }
-
-    return null;
-  }
-
-
-  public String getTitle() {
-    return stage.getTitle();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
deleted file mode 100644
index 1bb98d4..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.fx;
-
-import java.nio.MappedByteBuffer;
-import java.util.Observable;
-import java.util.Observer;
-
-public class VsdSeries  {
-  // TODO concurrency
-  
-  private MappedByteBuffer buffer = null;
-  
-  private int length = 0;
-  
-  
-  
-  
-  public void addData(long time, double value) {
-    if (buffer.remaining() < 8) {
-      expandBuffer();
-    }
-    
-    buffer.putLong(time);
-    buffer.putDouble(value);
-    length++;
-    
-    // TODO notify change
-  }
-
-  public int getLength() {
-    return length;
-  }
-
-  private void expandBuffer() {
-    // TODO Auto-generated method stub
-    
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c8a9cb6/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
deleted file mode 100644
index 53024d5..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pivotal.jvsd.model;
-
-import com.pivotal.jvsd.model.stats.StatArchiveFile;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
-* @author Jens Deppe
-*/
-public class ResourceWrapper {
-  private int row;
-
-  private StatArchiveFile.ResourceInst inst;
-
-  public ResourceWrapper(StatArchiveFile.ResourceInst inst, int idx) {
-    this.inst = inst;
-    this.row = idx;
-  }
-
-  public int getRow() {
-    return row;
-  }
-
-  public Date getStartTime() {
-    return new Date(inst.getFirstTimeMillis());
-  }
-
-  public int getSamples() {
-    return inst.getSampleCount();
-  }
-
-  public String getType() {
-    return inst.getType().getName();
-  }
-
-  public String getName() {
-    return inst.getName();
-  }
-
-  public List<String> getStatNames() {
-    List<String> statNames = new ArrayList<>();
-
-    for (StatArchiveFile.StatValue sv : inst.getStatValues()) {
-      if (!(sv.getSnapshotsAverage() == 0 && sv.getSnapshotsMaximum() == 0 &&
sv.
-          getSnapshotsMinimum() == 0)) {
-        statNames.add(sv.getDescriptor().getName());
-      }
-    }
-    return statNames;
-  }
-
-  public StatArchiveFile.StatValue getStatValue(String name) {
-    return inst.getStatValue(name);
-  }
-}



Mime
View raw message