Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmcmu committed Jul 3, 2024
1 parent ab84fa9 commit b89df5f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import org.hpccsystems.dfs.client.RowServiceOutputStream;
import org.hpccsystems.dfs.client.Utils;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.semconv.ServerAttributes;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -115,6 +117,20 @@ public HPCCRemoteFileWriter(DataPartition dp, FieldDef recordDef, IRecordAccesso
this.writeSpanName = "HPCCRemoteFileWriter.RowService/Write_" + dp.getFileName() + "_" + dp.getThisPart();
this.writeSpan = Utils.createSpan(writeSpanName);

String IPs = "";
for (int i = 0; i < dp.getCopyCount() ; i++)
{
IPs += dp.getCopyIP(i);
if (i < dp.getCopyCount() - 1)
{
IPs += ",";
}
}

Attributes attributes = Attributes.of( ServerAttributes.SERVER_ADDRESS, IPs,
ServerAttributes.SERVER_PORT, Long.valueOf(dp.getPort()));
writeSpan.setAllAttributes(attributes);

this.outputStream = new RowServiceOutputStream(dataPartition.getCopyIP(0), dataPartition.getPort(), dataPartition.getUseSsl(),
dataPartition.getFileAccessBlob(), this.recordDef, this.dataPartition.getThisPart(), this.dataPartition.getCopyPath(0),
fileCompression, connectTimeoutMs, socketOpTimeoutMs, this.writeSpan);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public RowServiceInputStream(DataPartition dp, FieldDef rd, FieldDef pRd, int co

this.dataPart = dp;

if (rdSpan != null && rdSpan.getSpanContext().isValid())
if (rdSpan != null)
{
this.readSpan = rdSpan;
this.traceContextHeader = org.hpccsystems.ws.client.utils.Utils.getTraceParentHeader(readSpan);
Expand Down

0 comments on commit b89df5f

Please sign in to comment.