This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Adapted from: https://github.com/jcrobak/avro-examples | |
import org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ | |
import org.apache.avro.generic.GenericRecord | |
import org.apache.avro.mapred.AvroKey | |
import org.apache.avro.mapreduce.AvroKeyInputFormat | |
import org.apache.hadoop.io.NullWritable | |
import org.apache.commons.lang.StringEscapeUtils.escapeCsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<descriptorRefs> | |
<descriptorRef>jar-with-dependencies</descriptorRef> | |
</descriptorRefs> | |
</configuration> | |
<executions> | |
<execution> | |
<id>make-assembly</id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.reflect.InvocationTargetException | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at com.julianpeeters.caseclass.generator.DynamicClassLoader.loadClass(DynamicClassLoader.java:18) | |
at com.julianpeeters.caseclass.generator.DynamicCaseClass.<init>(DynamicCaseClass.scala:24) | |
at Example$delayedInit$body.apply(TEST.scala:8) | |
at scala.Function0$class.apply$mcV$sp(Function0.scala:40) | |
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> test | |
java.lang.reflect.InvocationTargetException | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at com.julianpeeters.caseclass.generator.DynamicClassLoader.loadClass(DynamicClassLoader.java:19) | |
at com.julianpeeters.caseclass.generator.DynamicCaseClass.<init>(DynamicCaseClass.scala:24) | |
at IntIntSpec.<init>(IntIntSpec.scala:17) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] (run-main) scala.reflect.internal.FatalError: bad symbolic reference. A signature in sample.MyRecord_TYPESpec refers to type scala.Option[String] | |
[error] in package sample which is not available. | |
[error] It may be completely missing from the current classpath, or the version on | |
[error] the classpath might be incompatible with the version used when compiling sample.MyRecord_TYPESpec. | |
scala.reflect.internal.FatalError: bad symbolic reference. A signature in sample.MyRecord_TYPESpec refers to type scala.Option[String] | |
in package sample which is not available. | |
It may be completely missing from the current classpath, or the version on | |
the classpath might be incompatible with the version used when compiling sample.MyRecord_TYPESpec. | |
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49) | |
at scala.reflect.internal.SymbolTable.globalError(SymbolTable.scala:48) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stringToType(classNamespace: Option[String], fieldType: String): scala.reflect.runtime.universe.Type = { | |
def getBoxed(typeName: String): String = { | |
typeName.dropWhile( c => (c != '[') ).drop(1).dropRight(1) | |
} | |
fieldType match { | |
case "Byte" => typeOf[Byte] | |
case "Short" => typeOf[Short] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
correctParsedSig.get.bytes.map { byte => (byte & 0xff).toHexString }.mkString("[ ", " ", " ]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace("com.example") | |
/** | |
This is a comment for the whole protocol | |
*/ | |
protocol Example { | |
/** | |
The comment applies to the `NoSpaces` record, but is not indented to the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class DoSomething() | |
class ComputationActor extends Actor with Listeners { | |
def receive = listenerManagement orElse { | |
case DoSomething() = gossip(doSomething()) | |
} | |
def doSomething(): Compuation = ??? | |
} |