@@ -165,7 +165,7 @@ public void writeRecord(String entryName, @NonNull Record record) throws ReductE
165165
166166 URI uri = URI .create (reductClient .getServerProperties ().url ()
167167 + String .format (RecordURL .WRITE_ENTRY .getUrl (), name , entryName ) + new Queries (TS , timestamp ));
168- HttpRequest .Builder builder = HttpRequest .newBuilder ().uri (uri ).header (getContentTypeHeader (), record .getType ())
168+ HttpRequest .Builder builder = HttpRequest .newBuilder ().uri (uri ).header (getContentTypeHeader (), record .getContentType ())
169169 .POST (HttpRequest .BodyPublishers .ofByteArray (record .getBody ()));
170170
171171 reductClient .sendAndGetOnlySuccess (builder , HttpResponse .BodyHandlers .ofString ());
@@ -195,7 +195,7 @@ public void writeRecords(String entryName, Iterator<Record> records)
195195 byte [] byteBodyArray = record .getBody ();
196196 body = ArrayUtils .addAll (body , byteBodyArray );
197197 builder .header (getXReductTimeWithNumberHeader (record .getTimestamp ()),
198- byteBodyArray .length + "," + record .getType ());
198+ byteBodyArray .length + "," + record .getContentType ());
199199 }
200200 if (Objects .nonNull (body )) {
201201 builder .POST (HttpRequest .BodyPublishers .ofByteArray (body ));
@@ -225,7 +225,7 @@ public Record readRecord(String entryName, Long timestamp) throws ReductExceptio
225225 return Record .builder ().body (httpResponse .body ())
226226 .timestamp (httpResponse .headers ().firstValue (getXReductTimeHeader ()).map (Long ::parseLong )
227227 .orElseThrow (() -> new ReductException (X_REDUCT_TIME_IS_NOT_SUCH_LONG_FORMAT )))
228- .type (httpResponse .headers ().firstValue (getContentTypeHeader ())
228+ .contentType (httpResponse .headers ().firstValue (getContentTypeHeader ())
229229 .orElseThrow (() -> new ReductException (CONTENT_TYPE_IS_NOT_SET_IN_THE_RECORD )))
230230 .length (httpResponse .headers ().firstValue (getContentLengthHeader ()).map (Integer ::parseInt )
231231 .orElseThrow (() -> new ReductException (CONTENT_LENGTH_IS_NOT_SET_IN_THE_RECORD )))
@@ -255,7 +255,7 @@ public Record getMetaInfo(String entryName, Long timestamp) throws ReductExcepti
255255 return Record .builder ()
256256 .timestamp (httpResponse .headers ().firstValue (getXReductTimeHeader ()).map (Long ::parseLong )
257257 .orElseThrow (() -> new ReductException (X_REDUCT_TIME_IS_NOT_SUCH_LONG_FORMAT )))
258- .type (httpResponse .headers ().firstValue (getContentTypeHeader ())
258+ .contentType (httpResponse .headers ().firstValue (getContentTypeHeader ())
259259 .orElseThrow (() -> new ReductException (CONTENT_TYPE_IS_NOT_SET_IN_THE_RECORD )))
260260 .length (httpResponse .headers ().firstValue (getContentLengthHeader ()).map (Integer ::parseInt )
261261 .orElseThrow (() -> new ReductException (CONTENT_LENGTH_IS_NOT_SET_IN_THE_RECORD )))
@@ -389,7 +389,7 @@ public Record next() {
389389 byteBuffer .position (instance .getOffset ());
390390 byteBuffer .get (nextBody , 0 , instance .getLength ());
391391
392- return Record .builder ().body (nextBody ).timestamp (instance .getTs ()).type (instance .getType ())
392+ return Record .builder ().body (nextBody ).timestamp (instance .getTs ()).contentType (instance .getType ())
393393 .length (instance .getLength ()).build ();
394394 }
395395 }
0 commit comments