Package gov.usgs.earthquake.product.io
Class BinaryXmlIOComparison
- java.lang.Object
-
- gov.usgs.earthquake.product.io.BinaryXmlIOComparison
-
public class BinaryXmlIOComparison extends java.lang.Object
Compare io times of XML and Binary product formats. All conversion is done in memory to try to balance the tests. All writes use a BinaryProductSource to keep the playing field level.
-
-
Constructor Summary
Constructors Constructor Description BinaryXmlIOComparison()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Testing for classstatic void
testBinaryReads(Product product, int numReads)
Tests binary readingstatic void
testBinaryWrites(Product product, int numWrites)
Tests binary writesstatic void
testProductIO(Product product, int numRuns)
Tests product IOstatic void
testXmlReads(Product product, int numReads)
Tests XML readingstatic void
testXmlWrites(Product product, int numWrites)
tests xml writesstatic long
timeSerializeProduct(ProductSource source, ProductHandler handler)
Serializes product by streaming it to a handler
-
-
-
Method Detail
-
timeSerializeProduct
public static long timeSerializeProduct(ProductSource source, ProductHandler handler) throws java.lang.Exception
Serializes product by streaming it to a handler- Parameters:
source
- a productSourcehandler
- a productHandler- Returns:
- Time it took to stream source to handler
- Throws:
java.lang.Exception
- if error occurs
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
Testing for class- Parameters:
args
- CLI args- Throws:
java.lang.Exception
- if error occurs
-
testProductIO
public static void testProductIO(Product product, int numRuns) throws java.lang.Exception
Tests product IO- Parameters:
product
- ProducnumRuns
- int- Throws:
java.lang.Exception
- if error occurs
-
testXmlReads
public static void testXmlReads(Product product, int numReads) throws java.lang.Exception
Tests XML reading- Parameters:
product
- a productnumReads
- int- Throws:
java.lang.Exception
- if error occurs
-
testBinaryReads
public static void testBinaryReads(Product product, int numReads) throws java.lang.Exception
Tests binary reading- Parameters:
product
- a productnumReads
- int- Throws:
java.lang.Exception
- if error occurs
-
testBinaryWrites
public static void testBinaryWrites(Product product, int numWrites) throws java.lang.Exception
Tests binary writes- Parameters:
product
- a productnumWrites
- int- Throws:
java.lang.Exception
- if error occurs
-
testXmlWrites
public static void testXmlWrites(Product product, int numWrites) throws java.lang.Exception
tests xml writes- Parameters:
product
- a productnumWrites
- int- Throws:
java.lang.Exception
- if error occurs
-
-