Skip to content

Commit

Permalink
Remove unused classes from TableWriterNode
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr authored and wendigo committed Sep 19, 2024
1 parent 4e0969a commit fe242fa
Showing 1 changed file with 0 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package io.trino.sql.planner.plan;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand Down Expand Up @@ -647,141 +646,6 @@ public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session s
}
}

public static class DeleteTarget
extends WriterTarget
{
private final Optional<TableHandle> handle;
private final SchemaTableName schemaTableName;

@JsonCreator
public DeleteTarget(
@JsonProperty("handle") Optional<TableHandle> handle,
@JsonProperty("schemaTableName") SchemaTableName schemaTableName)
{
this.handle = requireNonNull(handle, "handle is null");
this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null");
}

@JsonProperty
public Optional<TableHandle> getHandle()
{
return handle;
}

@JsonIgnore
public TableHandle getHandleOrElseThrow()
{
return handle.orElseThrow(() -> new IllegalStateException("DeleteTarget does not contain handle"));
}

@JsonProperty
public SchemaTableName getSchemaTableName()
{
return schemaTableName;
}

@Override
public String toString()
{
return handle.map(Object::toString).orElse("[]");
}

@Override
public boolean supportsMultipleWritersPerPartition(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public OptionalInt getMaxWriterTasks(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}
}

public static class UpdateTarget
extends WriterTarget
{
private final Optional<TableHandle> handle;
private final SchemaTableName schemaTableName;
private final List<String> updatedColumns;
private final List<ColumnHandle> updatedColumnHandles;

@JsonCreator
public UpdateTarget(
@JsonProperty("handle") Optional<TableHandle> handle,
@JsonProperty("schemaTableName") SchemaTableName schemaTableName,
@JsonProperty("updatedColumns") List<String> updatedColumns,
@JsonProperty("updatedColumnHandles") List<ColumnHandle> updatedColumnHandles)
{
this.handle = requireNonNull(handle, "handle is null");
this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null");
checkArgument(updatedColumns.size() == updatedColumnHandles.size(), "updatedColumns size %s must equal updatedColumnHandles size %s", updatedColumns.size(), updatedColumnHandles.size());
this.updatedColumns = requireNonNull(updatedColumns, "updatedColumns is null");
this.updatedColumnHandles = requireNonNull(updatedColumnHandles, "updatedColumnHandles is null");
}

@JsonProperty
public Optional<TableHandle> getHandle()
{
return handle;
}

@JsonIgnore
public TableHandle getHandleOrElseThrow()
{
return handle.orElseThrow(() -> new IllegalStateException("UpdateTarge does not contain handle"));
}

@JsonProperty
public SchemaTableName getSchemaTableName()
{
return schemaTableName;
}

@JsonProperty
public List<String> getUpdatedColumns()
{
return updatedColumns;
}

@JsonProperty
public List<ColumnHandle> getUpdatedColumnHandles()
{
return updatedColumnHandles;
}

@Override
public String toString()
{
return handle.map(Object::toString).orElse("[]");
}

@Override
public boolean supportsMultipleWritersPerPartition(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public OptionalInt getMaxWriterTasks(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}
}

public static class TableExecuteTarget
extends WriterTarget
{
Expand Down

0 comments on commit fe242fa

Please sign in to comment.