Hi,
I am using "apache-storm-1.0.4" version of the storm and trying to build a
hdfs bolt in the topology. I am receiving the below compilation error.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 21.019 s
[INFO] Finished at: 2018-05-28T18:40:01-06:00
[INFO] Final Memory: 38M/170M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project storm-starter: Compilation failure
[ERROR]
/s/chopin/a/grad/skmishra/storm/apache-storm-1.0.4/examples/storm-starter/src/jvm/org/apache/storm/starter/KafkaStormSample.java:[113,77]
cannot find symbol
[ERROR] symbol: variable Units
[ERROR] location: class Pipeline.KafkaStormSample
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Below is the code I am using.
public static void configureHdfsBolt(TopologyBuilder builder, String
delimiter, String outputPath, String hdfsUri) {
RecordFormat format = new
DelimitedRecordFormat().withFieldDelimiter(delimiter);
SyncPolicy syncPolicy = new CountSyncPolicy(1000);
//FileRotationPolicy rotationPolicy = new TimedRotationPolicy(300,
TimedRotationPolicy.TimeUnit.SECONDS);
FileRotationPolicy rotationPolicy = new FileSizeRotationPolicy(5.0f,
Units.MB);
FileNameFormat fileNameFormat = new
DefaultFileNameFormat().withPath(outputPath);
HdfsBolt bolt = new HdfsBolt()
.withFsUrl(hdfsUri)
.withFileNameFormat(fileNameFormat)
.withRecordFormat(format)
.withRotationPolicy(rotationPolicy)
.withSyncPolicy(syncPolicy);
builder.setBolt("hdfsbolt", bolt).shuffleGrouping("predictor-ran");
}
I can see the storm-hdfs packages in the external directory and as per the
suggestion in the readme, I am using the plugins and dependencies in the
pom.xml. I am also importing the following libraries in my code.
import org.apache.storm.hdfs.bolt.HdfsBolt;
import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat;
import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat;
import org.apache.storm.hdfs.bolt.format.FileNameFormat;
import org.apache.storm.hdfs.bolt.format.RecordFormat;
import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy;
import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy;
import org.apache.storm.hdfs.bolt.rotation.TimedRotationPolicy;
import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy;
import org.apache.storm.hdfs.bolt.sync.SyncPolicy;
import org.apache.storm.hdfs.common.rotation.MoveFileAction;
But I am still receiving the above error. I do not understand what am I
missing. Any help is greatly appreciated.
Thanks and Regards,
Sitakanta Mishra