Define the HADOOP_CONF_DIR environment variable to your Hadoop configuration folder or add the following 2 lines in your code :
If you don't add this, your client will try to write to the local FS, hence resulting into the permission denied exception.
You can also try this approach:
FileSystem fs = path.getFileSystem(conf);
SequenceFile.Writer inputWriter = new SequenceFile.Writer(fs, conf, path, LongWritable.class, MyWritable.class);
inputWriter.append(new LongWritable(uniqueId++), new MyWritable(data));