Package sizzle.runtime

Examples of sizzle.runtime.SizzleRunner


    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.Hello", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text(""));
    mapReduceDriver.runTest();
  }
View Full Code Here


    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.Simple", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("1.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("2.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("3.0"));
    mapReduceDriver.addOutput(new Text("count[] = 3"), NullWritable.get());
    mapReduceDriver.addOutput(new Text("sum_of_squares[] = 14.0"), NullWritable.get());
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.SimpleCompound", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("1.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("2.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("3.0"));
    mapReduceDriver.addOutput(new Text("s[] = { 3, 6.0, 14.0 }"), NullWritable.get());
    mapReduceDriver.runTest();
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.QuickExample", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());

    mapReduceDriver.addInput(new LongWritable(0), new Text("abc,1"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("def,2"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("ghi,3"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("def,4"));
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.RealWordCount", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("To be, or not to be: that is the question:"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("Whether 'tis nobler in the mind to suffer"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("The slings and arrows of outrageous fortune,"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("Or to take arms against a sea of troubles,"));
    mapReduceDriver.addOutput(new Text("count[a] = 1"), NullWritable.get());
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.WordStats", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("To be, or not to be: that is the question:"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("Whether 'tis nobler in the mind to suffer"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("The slings and arrows of outrageous fortune,"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("Or to take arms against a sea of troubles,"));
    mapReduceDriver.addOutput(new Text("longest[] = outrageous weight 10.0"), NullWritable.get());
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.FilteredMeanValue", src, null, new Class<?>[] { SizzleRunner.class })
          .newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("0.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("1.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("0.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("2.0"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("0.0"));
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.StringConversion", src, null, new Class<?>[] { SizzleRunner.class })
          .newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("100"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("200"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("300"));
    mapReduceDriver.addOutput(new Text("out[] = 64"), NullWritable.get());
    mapReduceDriver.addOutput(new Text("out[] = 100"), NullWritable.get());
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);

    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.ValueQuartiles", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("6"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("47"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("49"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("15"));
    mapReduceDriver.addInput(new LongWritable(0), new Text("42"));
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
    SizzleParser.ReInit(new StringReader(source));
    final String src = codeGenerator.visit(SizzleParser.Start(), st);
    System.err.println(src);
    SizzleRunner sizzleRunner = null;
    try {
      sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.BigUglyWhen", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
    } catch (final CharSequenceCompilerException e) {
      for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
        System.err.println(d.toString());
      throw e;
    }

    final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
    mapReduceDriver.setMapper(sizzleRunner.getMapper());
    // TODO: add the combiner when MAPREDUCE-797 is integrated
    mapReduceDriver.setReducer(sizzleRunner.getReducer());
    mapReduceDriver.addInput(new LongWritable(0), new Text("test"));
    mapReduceDriver.addOutput(new Text("result[] = 36"), NullWritable.get());
    mapReduceDriver.runTest();
  }
View Full Code Here

TOP

Related Classes of sizzle.runtime.SizzleRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.