You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by vf...@apache.org on 2015/11/26 00:33:21 UTC

[3/5] incubator-geode git commit: GEODE-340 Deleting old code

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b9e0d9c0/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatArchiveFormat.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatArchiveFormat.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatArchiveFormat.java
deleted file mode 100644
index bbaef64..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatArchiveFormat.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*=========================================================================
- * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
- * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
- * All Rights Reserved.  
- *========================================================================
- */
-package com.pivotal.jvsd.stats;
-
-/**
- * StatArchiveFormat defines constants related to the statistic archive file
- * format.
- */
-public interface StatArchiveFormat {
-
-	/**
-	 * ARCHIVE_VERSION identifies the format of the contents of the archive. It
-	 * should be changed any time an incompatible change is made. Its current
-	 * value is <code>3</code>.
-	 * <p>
-	 * <ol>
-	 * <li> Changed from 2 to 3 with addition of
-	 * <code>RESOURCE_INSTANCE_INITIALIZE_TOKEN</code>
-	 * <li> Changed from 3 to 4 with addition of largerBetter boolean in statistic
-	 * descriptor
-	 * </ol>
-	 */
-	public static final byte ARCHIVE_VERSION = 4;
-
-	/**
-	 * Token consists of a timestamp and any statistic value changes.
-	 */
-	public static final byte SAMPLE_TOKEN = 0;
-	/**
-	 * Token defines a new resource type.
-	 */
-	public static final byte RESOURCE_TYPE_TOKEN = 1;
-	/**
-	 * Token defines a new resource instance.
-	 */
-	public static final byte RESOURCE_INSTANCE_CREATE_TOKEN = 2;
-	/**
-	 * Token notes that a previous resource instance no longer exists and thus
-	 * will have any more samples of its statistic values taken.
-	 */
-	public static final byte RESOURCE_INSTANCE_DELETE_TOKEN = 3;
-	/**
-	 * Token defines a new resource instance with initial data.
-	 */
-	public static final byte RESOURCE_INSTANCE_INITIALIZE_TOKEN = 4;
-	/**
-	 * Token defines a new archive and provides some global information about the
-	 * environment the archive was created in.
-	 */
-	public static final byte HEADER_TOKEN = 77;
-
-	/**
-	 * The value used to signal the end of a list of resource instances.
-	 */
-	public static final int ILLEGAL_RESOURCE_INST_ID = -1;
-	/**
-	 * The maximum value a resource inst id can have and still be stored in the
-	 * archive as an unsigned byte.
-	 */
-	public static final int MAX_BYTE_RESOURCE_INST_ID = 252;
-	/**
-	 * Used to say that the next two bytes contain the resource inst id as an
-	 * unsigned short.
-	 */
-	public static final int SHORT_RESOURCE_INST_ID_TOKEN = 253;
-	/**
-	 * Used to say that the next four bytes contain the resource inst id as an
-	 * int.
-	 */
-	public static final int INT_RESOURCE_INST_ID_TOKEN = 254;
-	/**
-	 * Used to say that the current byte represents the ILLEGAL_RESOURCE_INST_ID.
-	 */
-	public static final int ILLEGAL_RESOURCE_INST_ID_TOKEN = 255;
-	/**
-	 * The maximum value a resource inst id can have and still be stored in the
-	 * archive as an unsigned short.
-	 */
-	public static final int MAX_SHORT_RESOURCE_INST_ID = 65535;
-	/**
-	 * The value used to signal the end of a list of statistic samples.
-	 */
-	public static final int ILLEGAL_STAT_OFFSET = 255;
-
-	/**
-	 * The maximum value a timestamp can have and still be stored in the archive
-	 * as an unsigned short.
-	 */
-	public static final int MAX_SHORT_TIMESTAMP = 65534;
-	/**
-	 * Means the next 4 bytes contain the timestamp as an int.
-	 */
-	public static final int INT_TIMESTAMP_TOKEN = 65535;
-
-	/**
-	 * The maximum value a compact value can have and still be stored in the
-	 * archive as one byte.
-	 */
-	public static final int MAX_1BYTE_COMPACT_VALUE = Byte.MAX_VALUE;
-	/**
-	 * The minimum value a compact value can have and still be stored in the
-	 * archive as one byte.
-	 */
-	public static final int MIN_1BYTE_COMPACT_VALUE = Byte.MIN_VALUE + 7;
-	/**
-	 * The maximum value a compact value can have and still be stored in the
-	 * archive as two bytes.
-	 */
-	public static final int MAX_2BYTE_COMPACT_VALUE = Short.MAX_VALUE;
-	/**
-	 * The minimum value a compact value can have and still be stored in the
-	 * archive as two bytes.
-	 */
-	public static final int MIN_2BYTE_COMPACT_VALUE = Short.MIN_VALUE;
-
-	/**
-	 * Means the next 2 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_2_TOKEN = Byte.MIN_VALUE;
-	/**
-	 * Means the next 3 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_3_TOKEN = Byte.MIN_VALUE + 1;
-	/**
-	 * Means the next 4 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_4_TOKEN = Byte.MIN_VALUE + 2;
-	/**
-	 * Means the next 5 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_5_TOKEN = Byte.MIN_VALUE + 3;
-	/**
-	 * Means the next 6 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_6_TOKEN = Byte.MIN_VALUE + 4;
-	/**
-	 * Means the next 7 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_7_TOKEN = Byte.MIN_VALUE + 5;
-	/**
-	 * Means the next 8 bytes hold the compact value's data.
-	 */
-	public static final int COMPACT_VALUE_8_TOKEN = Byte.MIN_VALUE + 6;
-
-	/**
-	 * Statistic represents a <code>boolean</code> java primitive.
-	 */
-	public static final int BOOLEAN_CODE = 1;
-	/**
-	 * Statistic represents a <code>char</code> java primitive.
-	 */
-	public static final int CHAR_CODE = 2;
-	/**
-	 * Statistic represents a <code>char</code> java primitive.
-	 */
-	public static final int WCHAR_CODE = 12;
-	/**
-	 * Statistic represents a <code>byte</code> java primitive.
-	 */
-	public static final int BYTE_CODE = 3;
-	/**
-	 * Statistic represents a <code>short</code> java primitive.
-	 */
-	public static final int SHORT_CODE = 4;
-	/**
-	 * Statistic represents a <code>int</code> java primitive.
-	 */
-	public static final int INT_CODE = 5;
-	/**
-	 * Statistic represents a <code>long</code> java primitive.
-	 */
-	public static final int LONG_CODE = 6;
-	/**
-	 * Statistic represents a <code>float</code> java primitive.
-	 */
-	public static final int FLOAT_CODE = 7;
-	/**
-	 * Statistic represents a <code>double</code> java primitive.
-	 */
-	public static final int DOUBLE_CODE = 8;
-	/**
-	 * Number of nanoseconds in one millisecond
-	 */
-	public static final long NANOS_PER_MILLI = 1000000;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b9e0d9c0/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatFileManager.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatFileManager.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatFileManager.java
deleted file mode 100644
index f180adc..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/stats/StatFileManager.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package com.pivotal.jvsd.stats;
-
-import com.pivotal.jvsd.stats.StatFileParser.ResourceInst;
-import com.pivotal.jvsd.stats.StatFileParser.StatArchiveFile;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableModel;
-
-/**
- *
- * @author Vince Ford
- */
-public class StatFileManager {
-
-	Logger logger = null;
-	ArrayList<StatFileWrapper> fileList = null;
-
-	/**
-	 *
-	 */
-	public StatFileManager() {
-		logger = Logger.getLogger("com.gemstone.gemfire.support.StatFileManager");
-		logger.setUseParentHandlers(false);
-		ConsoleHandler ch = new ConsoleHandler();
-		ch.setLevel(Level.FINEST);
-		logger.addHandler(ch);
-		logger.setLevel(Level.FINEST);
-		fileList = new ArrayList<StatFileWrapper>();
-	}
-
-	/**
-	 *
-	 * @param filename
-	 */
-	public void dump() {
-		try {
-			File[] files = getFileList();
-			//uses the GemFire Methods to dump the file
-			StatFileParser sar = new StatFileParser(files, null, false);
-			List<ResourceInst> ril = sar.getResourceInstList();
-			Utility.dumpCharts(ril);
-			sar.update();
-			StatArchiveFile[] sa = sar.getArchives();
-			for (StatArchiveFile o : sa) {
-				System.out.println(o.getArchiveInfo().toString());
-			}
-			sar = null;
-		} catch (IOException ex) {
-			logger.log(Level.SEVERE, null, ex);
-		}
-	}
-
-	public void addFile(File file) {
-		StatFileWrapper fw = new StatFileWrapper(file);
-		fileList.add(fw);
-	}
-
-	public void addFile(String filename) {
-		File file = new File(filename);
-		StatFileWrapper fw = new StatFileWrapper(file);
-		fileList.add(fw);
-	}
-
-	File[] getFileList() {
-		File[] files = new File[fileList.size()];
-		int i = 0;
-		for (StatFileWrapper f : fileList) {
-			files[i] = f.getFile();
-			i++;
-		}
-		return files;
-	}
-
-	public void updateTableView(JTable table) {
-		DefaultTableModel tablemodel = (DefaultTableModel) table.getModel();
-		int index = 1;
-		int namelength = 0;
-
-		for (StatFileWrapper sfw : fileList) {
-			if (!sfw.isProcessed()) {
-				List<ResourceInst> resourceList = sfw.getResourceList();
-				int y = 0;
-				for (ResourceInst ri : resourceList) {
-					Object[] rowData = new Object[7];
-					rowData[0] = y;
-					rowData[1] = new Date(ri.getFirstTimeMillis());
-					rowData[2] = index;
-					rowData[3] = ri.getSampleCount();
-					rowData[4] = ri.getId();
-					rowData[5] = ri.getType().getName();
-					rowData[6] = ri.getName();
-					if (namelength < ri.getName().length()) {
-						namelength = ri.getName().length();
-					}
-					tablemodel.addRow(rowData);
-					y++;
-				}
-				sfw.setProcessed(true);
-			}
-			index++;
-		}
-
-	}
-
-	public List<String> getStats(int filenum, String type, String name, boolean hideZeros) {
-		StatFileWrapper stw = fileList.get(filenum - 1);
-		List<String> list = stw.getStats(type, name, hideZeros);
-		return list;
-	}
-
-	public StatFileWrapper getFile(int Index) {
-		return fileList.get(Index);
-	}
-
-	public int length() {
-		return fileList.size();
-	}
-}