Skip to content

Commit

Permalink
Formating and explain in more javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Aug 28, 2024
1 parent 88de936 commit 6cf8443
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 118 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ public OrdinalBytesRefVector asOrdinals() {
throw new UnsupportedOperationException("null vector");
}

@Override
public ToMask toMask() {
assert false : "null vector";
throw new UnsupportedOperationException("null vector");
}

@Override
public ConstantNullVector filter(int... positions) {
assert false : "null vector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ $if(BytesRef)$
}

$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
if (getPositionCount() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,8 @@ $if(BytesRef)$
public OrdinalBytesRefVector asOrdinals() {
return null;
}

$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
incRef();
return new ToMask(this, false);
}

$endif$

$if(BytesRef)$
@Override
public BytesRef getBytesRef(int position, BytesRef dest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ public final class $Type$BigArrayBlock extends AbstractArrayBlock implements $Ty
}

$if(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
if (getPositionCount() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,6 @@ $endif$
return new $Type$VectorBlock(this);
}

$if(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
incRef();
return new ToMask(this, false);
}
$endif$

@Override
public $type$ get$Type$(int position) {
return values.get(position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ $if(BytesRef)$
$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
* passing to {@link #keepMask}. Null and multivalued positions will be
* converted to {@code false}.
*/
ToMask toMask();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,8 @@ $if(BytesRef)$
public OrdinalBytesRefVector asOrdinals() {
return null;
}

$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
incRef();
return new ToMask(this, false);
}

$endif$

@Override
public $Type$Vector filter(int... positions) {
return blockFactory().newConstant$Type$Vector(value, positions.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ $if(BytesRef)$
*/
OrdinalBytesRefVector asOrdinals();

$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
ToMask toMask();

$endif$
@Override
$Type$Vector filter(int... positions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@ $if(BytesRef)$
}

$elseif(boolean)$
/**
* Convert this to a {@link BooleanVector "mask"} that's appropriate for
* passing to {@link #keepMask}.
*/
@Override
public ToMask toMask() {
return vector.toMask();
vector.incRef();
return new ToMask(vector, false);
}

$endif$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,7 @@ public void testBooleanBlock() {
IntStream.range(0, positionCount).mapToObj(ii -> randomBoolean()).forEach(vectorBuilder::appendBoolean);
BooleanVector vector = vectorBuilder.build();
assertSingleValueDenseBlock(vector.asBlock());
try (ToMask mask = vector.toMask()) {
assertThat(mask.hadMultivaluedFields(), equalTo(false));
assertThat(mask.mask(), sameInstance(vector));
}
assertToMask(vector);
releaseAndAssertBreaker(vector.asBlock());
}
}
Expand Down Expand Up @@ -1422,7 +1419,7 @@ static void assertToMaskZeroPositions(BooleanBlock block) {
}

static void assertToMask(BooleanVector vector) {
try (ToMask mask = vector.toMask()) {
try (ToMask mask = vector.asBlock().toMask()) {
assertThat(mask.mask(), sameInstance(vector));
assertThat(mask.hadMultivaluedFields(), equalTo(false));
}
Expand Down

0 comments on commit 6cf8443

Please sign in to comment.