case class FileSink(filePath: String, format: Format = CsvFormat()) extends FormatAgnosticSink with Product with Serializable
A Sink that writes a Table
into files using the given format
.
This sink creates a directory named after the jobID inside the provided filepath
. Each partition on the server then writes into its own file within this directory.
- filePath
the filepath to write the table into
- format
the format to be used by this sink (
CsvFormat
by default)
import com.raphtory.algorithms.generic.EdgeList import com.raphtory.sinks.FileSink import com.raphtory.spouts.FileSpout val graphBuilder = new YourGraphBuilder() val graph = Raphtory.stream(FileSpout("/path/to/your/file"), graphBuilder) val testDir = "/tmp/raphtoryTest" val sink = FileSink(testDir) graph.execute(EdgeList()).writeTo(sink)
- See also
- Alphabetic
- By Inheritance
- FileSink
- Serializable
- Product
- Equals
- FormatAgnosticSink
- Sink
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
- Private
Instance Constructors
- new FileSink(filePath: String, format: Format = CsvFormat())
- filePath
the filepath to write the table into
- format
the format to be used by this sink (
CsvFormat
by default)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def buildConnector(jobID: String, partitionID: Int, config: Config, itemDelimiter: String, fileExtension: String): SinkConnector
Builds a SinkConnector to be used by Raphtory for writing a table using the provided Format.
Builds a SinkConnector to be used by Raphtory for writing a table using the provided Format.
- jobID
The ID of the job that generated the table
- partitionID
The ID of the partition of the table
- config
The configuration provided by the user
- itemDelimiter
The
String
to be used as a delimiter between items when necessary- returns
The SinkConnector implementing the execution of this
FormatAgnosticSink
- Definition Classes
- FileSink → FormatAgnosticSink
- See also
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def executor(jobID: String, partitionID: Int, config: Config): SinkExecutor
- jobID
the ID of the job that generated the table
- partitionID
the ID of the partition of the table
- config
the configuration provided by the user
- returns
the
SinkExecutor
to be used for writing out results
- Definition Classes
- FormatAgnosticSink → Sink
- val filePath: String
- val format: Format
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated