diff --git a/pom.xml b/pom.xml index 5284f4a..0c6c354 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ crunchTS jar 0.0.2-SNAPSHOT - crunchTS + crunch.TS http://maven.apache.org diff --git a/src/main/java/de/bitocean/crunchts/simple/ImportClickCountData.java b/src/main/java/de/bitocean/crunchts/simple/ImportClickCountData.java index ff23849..1897d8e 100644 --- a/src/main/java/de/bitocean/crunchts/simple/ImportClickCountData.java +++ b/src/main/java/de/bitocean/crunchts/simple/ImportClickCountData.java @@ -114,7 +114,7 @@ public void initialize() { fileName = ((CombineFileSplit) inputSplit).getPaths()[0].getName(); } - timestamp = wikipedia.TimeStampTool.getTimeInMillis(fileName); + timestamp = de.bitocean.util.wikipedia.TimeStampTool.getTimeInMillis(fileName); } catch (ClassCastException e) { e.printStackTrace(); diff --git a/src/main/java/org/apache/crunchts/TSData.java b/src/main/java/de/bitocean/data/TSData.java similarity index 99% rename from src/main/java/org/apache/crunchts/TSData.java rename to src/main/java/de/bitocean/data/TSData.java index 3aa4bc9..479bc90 100755 --- a/src/main/java/org/apache/crunchts/TSData.java +++ b/src/main/java/de/bitocean/data/TSData.java @@ -1,4 +1,4 @@ -package org.apache.crunchts; +package de.bitocean.data; import java.io.BufferedReader; import java.io.DataInput; import java.io.DataOutput; diff --git a/src/main/java/de/bitocean/relevance/WebResourceBucketNodeDegree.java b/src/main/java/de/bitocean/relevance/WebResourceBucketNodeDegree.java index a4032d4..27a485d 100644 --- a/src/main/java/de/bitocean/relevance/WebResourceBucketNodeDegree.java +++ b/src/main/java/de/bitocean/relevance/WebResourceBucketNodeDegree.java @@ -113,7 +113,7 @@ public void initialize() { fileName = ((CombineFileSplit) inputSplit).getPaths()[0].getName(); } - timestamp = wikipedia.TimeStampTool.getTimeInMillis(fileName); + timestamp = de.bitocean.util.wikipedia.TimeStampTool.getTimeInMillis(fileName); } catch (ClassCastException e) { e.printStackTrace(); diff --git a/src/main/java/wikipedia/TimeStampTool.java b/src/main/java/de/bitocean/util/wikipedia/TimeStampTool.java similarity index 54% rename from src/main/java/wikipedia/TimeStampTool.java rename to src/main/java/de/bitocean/util/wikipedia/TimeStampTool.java index adc8bd4..02050e3 100644 --- a/src/main/java/wikipedia/TimeStampTool.java +++ b/src/main/java/de/bitocean/util/wikipedia/TimeStampTool.java @@ -1,17 +1,35 @@ -package wikipedia; +package de.bitocean.util.wikipedia; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; /** - * Based on a filename like "pagecounts-20071210-010000.gz" - * the time in millis is calculated. + * Wikipedia Click-Count data is public available. + * + * Each file contains aggregated hourly click-counts for all + * Wikipedia pages. + * + * Based on the filename like "pagecounts-20071210-010000.gz" + * the time stamp in milli seconds is calculated. + * + * The timestamp represents the beginning of the hour for which data + * is provided. Due to inqaccuracy one can not relay on all digits. + * + * This implementation does not do any kind of correction. + * More advanced testing is required for future releases. * - * @author root + * @author Mirko Kämpf + * */ public class TimeStampTool { + /** + * Extract time stamp from click-count file name. + * + * @param filename + * @return timestamp in ms + */ static public long getTimeInMillis(String filename) { // System.out.println( filename ); String[] s = filename.split("-"); diff --git a/src/main/java/org/apache/crunchts/CrunchTSApp.java b/src/main/java/org/apache/crunchts/CrunchTSApp.java index 0920226..b059b87 100644 --- a/src/main/java/org/apache/crunchts/CrunchTSApp.java +++ b/src/main/java/org/apache/crunchts/CrunchTSApp.java @@ -1,19 +1,18 @@ /** - * 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 + * 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 + * 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. + * 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 org.apache.crunchts; @@ -48,381 +47,296 @@ */ public class CrunchTSApp extends FsShell { - /** - * An abstract class for the execution of a time series command - */ - abstract private static class TSToolsCommand extends Command { - final DistributedFileSystem dfs; - - /** Constructor */ - public TSToolsCommand(FileSystem fs) { - super(fs.getConf()); - if (!(fs instanceof DistributedFileSystem)) { - throw new IllegalArgumentException("FileSystem " + fs.getUri() - + " is not a distributed file system"); - } - this.dfs = (DistributedFileSystem) fs; - } - } - - /** - * Construct a DFSAdmin object. - */ - public CrunchTSApp() { - this(null); - } - - /** - * Construct a DFSAdmin object. - */ - public CrunchTSApp(Configuration conf) { - super(conf); - } - - /** - * Gives a report on how the FileSystem is doing. - * - * @exception IOException - * if the filesystem does not exist. - */ - public void report() throws IOException { - System.out.println("TimeSeries Bucket report is omming soon ..."); - if (fs instanceof DistributedFileSystem) { - DistributedFileSystem dfs = (DistributedFileSystem) fs; - FsStatus ds = dfs.getStatus(); - long capacity = ds.getCapacity(); - long used = ds.getUsed(); - long remaining = ds.getRemaining(); - long presentCapacity = used + remaining; - - System.out.println("Configured Capacity: " + capacity + " (" - + StringUtils.byteDesc(capacity) + ")"); - System.out.println("Present Capacity: " + presentCapacity + " (" - + StringUtils.byteDesc(presentCapacity) + ")"); - System.out.println("DFS Remaining: " + remaining + " (" - + StringUtils.byteDesc(remaining) + ")"); - System.out.println("DFS Used: " + used + " (" - + StringUtils.byteDesc(used) + ")"); - System.out - .println("DFS Used%: " - + StringUtils - .limitDecimalTo2(((1.0 * used) / presentCapacity) * 100) - + "%"); - } - } - - private void printHelp(String cmd) { - String summary = "hadoop dfsadmin is the command to execute DFS administrative commands.\n" - + "The full syntax is: \n\n" - + "hadoop dfsadmin [-report] [-safemode ]\n" - + "\t[-saveNamespace]\n" - + "\t[-refreshNodes]\n" - + "\t[-refreshServiceAcl]\n" + "\t[-help [cmd]]\n"; - - String report = "-report: \tReports basic filesystem information and statistics.\n"; - - String safemode = "-safemode : Safe mode maintenance command.\n" - + "\t\tSafe mode is a Namenode state in which it\n" - + "\t\t\t1. does not accept changes to the name space (read-only)\n" - + "\t\t\t2. does not replicate or delete blocks.\n" - + "\t\tSafe mode is entered automatically at Namenode startup, and\n" - + "\t\tleaves safe mode automatically when the configured minimum\n" - + "\t\tpercentage of blocks satisfies the minimum replication\n" - + "\t\tcondition. Safe mode can also be entered manually, but then\n" - + "\t\tit can only be turned off manually as well.\n"; - - String saveNamespace = "-saveNamespace:\t" - + "Save current namespace into storage directories and reset edits log.\n" - + "\t\tRequires superuser permissions and safe mode.\n"; - - String refreshNodes = "-refreshNodes: \tUpdates the set of hosts allowed " - + "to connect to namenode.\n\n" - + "\t\tRe-reads the config file to update values defined by \n" - + "\t\tdfs.hosts and dfs.host.exclude and reads the \n" - + "\t\tentires (hostnames) in those files.\n\n" - + "\t\tEach entry not defined in dfs.hosts but in \n" - + "\t\tdfs.hosts.exclude is decommissioned. Each entry defined \n" - + "\t\tin dfs.hosts and also in dfs.host.exclude is stopped from \n" - + "\t\tdecommissioning if it has aleady been marked for decommission.\n" - + "\t\tEntires not present in both the lists are decommissioned.\n"; - - String finalizeUpgrade = "-finalizeUpgrade: Finalize upgrade of HDFS.\n" - + "\t\tDatanodes delete their previous version working directories,\n" - + "\t\tfollowed by Namenode doing the same.\n" - + "\t\tThis completes the upgrade process.\n"; - - String upgradeProgress = "-upgradeProgress : \n" - + "\t\trequest current distributed upgrade status, \n" - + "\t\ta detailed status or force the upgrade to proceed.\n"; - - String metaSave = "-metasave : \tSave Namenode's primary data structures\n" - + "\t\tto in the directory specified by hadoop.log.dir property.\n" - + "\t\t will contain one line for each of the following\n" - + "\t\t\t1. Datanodes heart beating with Namenode\n" - + "\t\t\t2. Blocks waiting to be replicated\n" - + "\t\t\t3. Blocks currrently being replicated\n" - + "\t\t\t4. Blocks waiting to be deleted\n"; - - String refreshServiceAcl = "-refreshServiceAcl: Reload the service-level authorization policy file\n" - + "\t\tNamenode will reload the authorization policy file.\n"; - - String help = "-help [cmd]: \tDisplays help for the given command or all commands if none\n" - + "\t\tis specified.\n"; - - if ("report".equals(cmd)) { - System.out.println(report); - } else if ("safemode".equals(cmd)) { - System.out.println(safemode); - } else if ("saveNamespace".equals(cmd)) { - System.out.println(saveNamespace); - } else if ("refreshNodes".equals(cmd)) { - System.out.println(refreshNodes); - } else if ("finalizeUpgrade".equals(cmd)) { - System.out.println(finalizeUpgrade); - } else if ("upgradeProgress".equals(cmd)) { - System.out.println(upgradeProgress); - } else if ("metasave".equals(cmd)) { - System.out.println(metaSave); - } else if ("refreshServiceAcl".equals(cmd)) { - System.out.println(refreshServiceAcl); - } else if ("help".equals(cmd)) { - System.out.println(help); - } else { - System.out.println(summary); - System.out.println(report); - System.out.println(safemode); - System.out.println(saveNamespace); - System.out.println(refreshNodes); - System.out.println(finalizeUpgrade); - System.out.println(upgradeProgress); - System.out.println(metaSave); - System.out.println(refreshServiceAcl); - System.out.println(help); - System.out.println(); - ToolRunner.printGenericCommandUsage(System.out); - } - - } - - /** - * Displays format of commands. - * - * @param cmd - * The command that is being executed. - */ - private static void printUsage(String cmd) { - if ("-report".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-report]"); - } else if ("-safemode".equals(cmd)) { - System.err.println("Usage: crunchts" - + " [-safemode enter | leave | get | wait]"); - } else if ("-saveNamespace".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-saveNamespace]"); - } else if ("-refreshNodes".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-refreshNodes]"); - } else if ("-finalizeUpgrade".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-finalizeUpgrade]"); - } else if ("-upgradeProgress".equals(cmd)) { - System.err.println("Usage: crunchts" - + " [-upgradeProgress status | details | force]"); - } else if ("-metasave".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-metasave filename]"); - } else if ("-refreshServiceAcl".equals(cmd)) { - System.err.println("Usage: crunchts" + " [-refreshServiceAcl]"); - } else { - System.err.println("Usage: crunchts"); - System.err.println(" [-report]"); - System.err - .println(" [-safemode enter | leave | get | wait]"); - System.err.println(" [-saveNamespace]"); - System.err.println(" [-refreshNodes]"); - System.err.println(" [-finalizeUpgrade]"); - System.err - .println(" [-upgradeProgress status | details | force]"); - System.err.println(" [-metasave filename]"); - System.err.println(" [-refreshServiceAcl]"); - System.err.println(" [-help [cmd]]"); - System.err.println(); - ToolRunner.printGenericCommandUsage(System.err); - } - } - - /** - * @param argv - * The parameters passed to this program. - * @exception Exception - * if the filesystem does not exist. - * @return 0 on success, non zero on error. - */ - @Override - public int run(String[] argv) throws Exception { - - if (argv.length < 1) { - printUsage(""); - return -1; - } - - int exitCode = -1; - int i = 0; - String cmd = argv[i++]; - - // - // verify that we have enough command line parameters - // - if ("-convert".equals(cmd)) { - if (argv.length != 3) { - printUsage(cmd); - return exitCode; - } - } else if ("-pairs".equals(cmd)) { - if (argv.length != 3) { - printUsage(cmd); - return exitCode; - } - } else if ("-triples".equals(cmd)) { - if (argv.length != 3) { - printUsage(cmd); - return exitCode; - } - } - - // initialize CrunchTSApp - try { - init(); - } catch (RPC.VersionMismatch v) { - System.err.println("Version Mismatch between client and server" - + "... command aborted."); - return exitCode; - } catch (IOException e) { - System.err.println("Bad connection to DFS... command aborted."); - return exitCode; - } - - exitCode = 0; - try { - if ("-report".equals(cmd)) { - report(); - } else if ("-convert".equals(cmd)) { - convert(argv); - } else if ("-pairs".equals(cmd)) { - pairs(argv); - } else if ("-triples".equals(cmd)) { - triples(argv); - } else if ("-pairsandtriples".equals(cmd)) { - pairsAndTriples(argv); - } else if ("-help".equals(cmd)) { - if (i < argv.length) { - printHelp(argv[i]); - } else { - printHelp(""); - } - } else { - exitCode = -1; - System.err.println(cmd.substring(1) + ": Unknown command"); - printUsage(""); - } - } catch (IllegalArgumentException arge) { - exitCode = -1; - System.err.println(cmd.substring(1) + ": " - + arge.getLocalizedMessage()); - printUsage(cmd); - } catch (RemoteException e) { - // - // This is a error returned by hadoop server. Print - // out the first line of the error mesage, ignore the stack trace. - exitCode = -1; - try { - String[] content; - content = e.getLocalizedMessage().split("\n"); - System.err.println(cmd.substring(1) + ": " + content[0]); - } catch (Exception ex) { - System.err.println(cmd.substring(1) + ": " - + ex.getLocalizedMessage()); - } - } catch (Exception e) { - exitCode = -1; - System.err.println(cmd.substring(1) + ": " - + e.getLocalizedMessage()); - } - return exitCode; - } - - private void pairsAndTriples(String[] argv) { - System.out.println("PAIRS and TRIPLES"); - try { - String[] arguments = new String[2]; - arguments[0] = argv[1]; - arguments[1] = argv[2]; - int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesPairsAndTriplesFromTSBucket(), arguments); - } - catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - private void triples(String[] argv) { - System.out.println("TRIPLES"); - try { - String[] arguments = new String[2]; - arguments[0] = argv[1]; - arguments[1] = argv[2]; - int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesTriplesFromTSBucket(), arguments); - } - catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private void pairs(String[] argv) { - System.out.println("PAIRS"); - try { - String[] arguments = new String[2]; - arguments[0] = argv[1]; - arguments[1] = argv[2]; - int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesPairsFromTSBucket(), arguments); - } - catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private void convert(String[] argv) { - System.out.println("CONVERT"); - try { - String[] arguments = new String[2]; - arguments[0] = argv[1]; - arguments[1] = argv[2]; - int exitCode = ToolRunner.run(new Configuration(), new ConvertTSBucket(), arguments); - } - catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - protected FileSystem fs; - - protected void init() throws IOException { - getConf().setQuietMode(true); - if (this.fs == null) { - this.fs = FileSystem.get(getConf()); - } - } - - /** - * main() has some simple utility methods. - * - * @param argv - * Command line parameters. - * @exception Exception - * if the filesystem does not exist. - */ - public static void main(String[] argv) throws Exception { - int res = ToolRunner.run(new CrunchTSApp(), argv); - System.exit(res); - } + /** + * An abstract class for the execution of a time series command + */ + abstract private static class TSToolsCommand extends Command { + + final DistributedFileSystem dfs; + + /** + * Constructor + */ + public TSToolsCommand(FileSystem fs) { + super(fs.getConf()); + if (!(fs instanceof DistributedFileSystem)) { + throw new IllegalArgumentException("FileSystem " + fs.getUri() + + " is not a distributed file system"); + } + this.dfs = (DistributedFileSystem) fs; + } + } + + /** + * Construct a DFSAdmin object. + */ + public CrunchTSApp() { + this(null); + } + + /** + * Construct a DFSAdmin object. + */ + public CrunchTSApp(Configuration conf) { + super(conf); + } + + /** + * Gives a report for a time series bucket. + * + * @exception IOException if the tsbucket does not exist. + */ + public void report(String tsbFilePath) throws IOException { + System.out.println("Time-Series-Bucket report (TSBr) is comming soon ..."); + + System.out.println("> path: " + tsbFilePath); + + if (fs instanceof DistributedFileSystem) { + + DistributedFileSystem dfs = (DistributedFileSystem) fs; + FsStatus ds = dfs.getStatus(); + + long capacity = ds.getCapacity(); + long used = ds.getUsed(); + long remaining = ds.getRemaining(); + long presentCapacity = used + remaining; + + System.out.println("FS Configured Capacity: " + capacity + " (" + + StringUtils.byteDesc(capacity) + ")"); + System.out.println("FS Present Capacity: " + presentCapacity + " (" + + StringUtils.byteDesc(presentCapacity) + ")"); + System.out.println("DFS Remaining: " + remaining + " (" + + StringUtils.byteDesc(remaining) + ")"); + System.out.println("DFS Used: " + used + " (" + + StringUtils.byteDesc(used) + ")"); + System.out + .println("DFS Used%: " + + StringUtils + .limitDecimalTo2(((1.0 * used) / presentCapacity) * 100) + + "%"); + } + } + + private void printHelp(String cmd) { + + String summary = "hadoop tsb is the command to execute TSB administrative commands.\n" + + "The full syntax is: \n\n" + + "hadoop tsb [-report] " + + "\t[-explode [pairs|triples] ]\n" + + "\t[-cc]\n" + + "\t[-es]\n" + + "\t[-gc]\n" + "\t[-help [cmd]]\n"; + + String report = "-report: \tReports basic filesystem information and statistics.\n"; + + String explode = "-explode : Explode the time series bucket into a TS-Pair-Bucket.\n"; + + String cc = "-cc:\t"; + + String es = "-es:\t"; + + String gc = "-gc:\t"; + + String help = "-help [cmd]: \tDisplays help for the given command or all commands if none\n" + + "\t\tis specified.\n"; + + if ("report".equals(cmd)) { + System.out.println(report); + } else if ("explode".equals(cmd)) { + System.out.println(explode); + } else if ("cc".equals(cmd)) { + System.out.println(cc); + } else if ("es".equals(cmd)) { + System.out.println(es); + } else if ("help".equals(cmd)) { + System.out.println(help); + } else if ("gc".equals(cmd)) { + System.out.println(gc); + } else { + System.out.println(summary); + System.out.println(report); + System.out.println(explode); + System.out.println(cc); + System.out.println(es); + System.out.println(gc); + System.out.println(help); + System.out.println(); + ToolRunner.printGenericCommandUsage(System.out); + } + + } + + /** + * @param argv The parameters passed to this program. + * @exception Exception if the filesystem does not exist. + * @return 0 on success, non zero on error. + */ + @Override + public int run(String[] argv) throws Exception { + + if (argv.length < 1) { + printHelp(""); + return -1; + } + + int exitCode = -1; + int i = 0; + String cmd = argv[i++]; + + // + // verify that we have enough command line parameters + // + if ("-explode".equals(cmd)) { + if (argv.length != 3) { + printHelp(cmd); + return exitCode; + } + } else if ("-cc".equals(cmd)) { + if (argv.length != 2) { + printHelp(cmd); + return exitCode; + } + } else if ("-es".equals(cmd)) { + if (argv.length != 2) { + printHelp(cmd); + return exitCode; + } + } + + // initialize CrunchTSApp + try { + init(); + } catch (RPC.VersionMismatch v) { + System.err.println("Version Mismatch between client and server" + + "... command aborted."); + return exitCode; + } catch (IOException e) { + System.err.println("Bad connection to DFS... command aborted."); + return exitCode; + } + + exitCode = 0; + try { + if ("-report".equals(cmd)) { + report(null); + } else if ("-explode".equals(cmd)) { + explode(argv); + } else if ("-help".equals(cmd)) { + if (i < argv.length) { + printHelp(argv[i]); + } else { + printHelp(""); + } + } else { + exitCode = -1; + System.err.println(cmd.substring(1) + ": Unknown command"); + printHelp(""); + } + } catch (IllegalArgumentException arge) { + exitCode = -1; + System.err.println(cmd.substring(1) + ": " + + arge.getLocalizedMessage()); + printHelp(cmd); + } catch (RemoteException e) { + // + // This is a error returned by hadoop server. Print + // out the first line of the error mesage, ignore the stack trace. + exitCode = -1; + try { + String[] content; + content = e.getLocalizedMessage().split("\n"); + System.err.println(cmd.substring(1) + ": " + content[0]); + } catch (Exception ex) { + System.err.println(cmd.substring(1) + ": " + + ex.getLocalizedMessage()); + } + } catch (Exception e) { + exitCode = -1; + System.err.println(cmd.substring(1) + ": " + + e.getLocalizedMessage()); + } + return exitCode; + } + + private void explode(String[] argv) { + if (argv[1].equals("pairs")) { + pairs(argv); + } else if (argv[1].equals("triples")) { + triples(argv); + } else if (argv[1].equals("pairsandtriples")) { + pairsAndTriples(argv); + } + } + + private void pairsAndTriples(String[] argv) { + System.out.println("Create TS PAIRS and TRIPLES"); + try { + String[] arguments = new String[2]; + arguments[0] = argv[1]; + arguments[1] = argv[2]; + int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesPairsAndTriplesFromTSBucket(), arguments); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + private void triples(String[] argv) { + System.out.println("TRIPLES"); + try { + String[] arguments = new String[2]; + arguments[0] = argv[1]; + arguments[1] = argv[2]; + int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesTriplesFromTSBucket(), arguments); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private void pairs(String[] argv) { + System.out.println("PAIRS"); + try { + String[] arguments = new String[2]; + arguments[0] = argv[1]; + arguments[1] = argv[2]; + int exitCode = ToolRunner.run(new Configuration(), new CombineTimeSeriesPairsFromTSBucket(), arguments); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Converts TS bucket into new representation. + * + * @param argv + */ + private void convert(String[] argv) { + System.out.println("TRANSFORM"); + try { + String[] arguments = new String[2]; + arguments[0] = argv[1]; + arguments[1] = argv[2]; + int exitCode = ToolRunner.run(new Configuration(), new ConvertTSBucket(), arguments); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + protected FileSystem fs; + + protected void init() throws IOException { + getConf().setQuietMode(true); + if (this.fs == null) { + this.fs = FileSystem.get(getConf()); + } + } + + public static void main(String[] argv) throws Exception { + int res = ToolRunner.run(new CrunchTSApp(), argv); + System.exit(res); + } } diff --git a/src/main/java/org/apache/crunchts/pojo/PropertiesVector.java b/src/main/java/org/apache/crunchts/pojo/PropertiesVector.java index 1feccf8..7dd4eed 100644 --- a/src/main/java/org/apache/crunchts/pojo/PropertiesVector.java +++ b/src/main/java/org/apache/crunchts/pojo/PropertiesVector.java @@ -8,7 +8,7 @@ import java.io.UnsupportedEncodingException; import java.util.Properties; -import org.apache.crunchts.TSData; +import de.bitocean.data.TSData; import org.apache.mahout.math.DenseVector; import org.apache.mahout.math.NamedVector; import org.apache.mahout.math.Vector; diff --git a/target/classes/.netbeans_automatic_build b/target/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/target/classes/de/bitocean/crunchts/simple/ImportClickCountData$1.class b/target/classes/de/bitocean/crunchts/simple/ImportClickCountData$1.class index 4df07f1..f51ad5c 100644 Binary files a/target/classes/de/bitocean/crunchts/simple/ImportClickCountData$1.class and b/target/classes/de/bitocean/crunchts/simple/ImportClickCountData$1.class differ diff --git a/target/classes/org/apache/crunchts/TSData.class b/target/classes/de/bitocean/data/TSData.class similarity index 85% rename from target/classes/org/apache/crunchts/TSData.class rename to target/classes/de/bitocean/data/TSData.class index e8e8727..085c5e3 100644 Binary files a/target/classes/org/apache/crunchts/TSData.class and b/target/classes/de/bitocean/data/TSData.class differ diff --git a/target/classes/de/bitocean/relevance/WebResourceBucketNodeDegree$1.class b/target/classes/de/bitocean/relevance/WebResourceBucketNodeDegree$1.class index 50af43f..7f64f83 100644 Binary files a/target/classes/de/bitocean/relevance/WebResourceBucketNodeDegree$1.class and b/target/classes/de/bitocean/relevance/WebResourceBucketNodeDegree$1.class differ diff --git a/target/classes/de/bitocean/util/wikipedia/TimeStampTool.class b/target/classes/de/bitocean/util/wikipedia/TimeStampTool.class new file mode 100644 index 0000000..409f144 Binary files /dev/null and b/target/classes/de/bitocean/util/wikipedia/TimeStampTool.class differ diff --git a/target/classes/org/apache/crunchts/CrunchTSApp$TSToolsCommand.class b/target/classes/org/apache/crunchts/CrunchTSApp$TSToolsCommand.class index ead6080..9ce860d 100644 Binary files a/target/classes/org/apache/crunchts/CrunchTSApp$TSToolsCommand.class and b/target/classes/org/apache/crunchts/CrunchTSApp$TSToolsCommand.class differ diff --git a/target/classes/org/apache/crunchts/CrunchTSApp.class b/target/classes/org/apache/crunchts/CrunchTSApp.class index aa633a6..15019e5 100644 Binary files a/target/classes/org/apache/crunchts/CrunchTSApp.class and b/target/classes/org/apache/crunchts/CrunchTSApp.class differ diff --git a/target/classes/org/apache/crunchts/pojo/PropertiesVector.class b/target/classes/org/apache/crunchts/pojo/PropertiesVector.class index 0d0646b..5e4e7a0 100644 Binary files a/target/classes/org/apache/crunchts/pojo/PropertiesVector.class and b/target/classes/org/apache/crunchts/pojo/PropertiesVector.class differ diff --git a/target/classes/wikipedia/TimeStampTool.class b/target/classes/wikipedia/TimeStampTool.class deleted file mode 100644 index ac87ab7..0000000 Binary files a/target/classes/wikipedia/TimeStampTool.class and /dev/null differ diff --git a/target/test-classes/.netbeans_automatic_build b/target/test-classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29