Enable compression for StringRecordWriterProvider

Please see if the code and merge it if it is ok.
I am using Json format for data.
I want to be able to set the compression in StringRecordWriterProvider.