mirror of https://github.com/apache/druid.git
Remove duplicate FrameRowTooLargeException.java (#13441)
* Removing duplicate FrameRowTooLargeException.java * Fixing intellij inspection
This commit is contained in:
parent
100a2aa4a2
commit
edd076ca69
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.frame.write;
|
||||
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
|
||||
/**
|
||||
* Exception that is conventionally thrown by workers when they call
|
||||
* {@link FrameWriter#addSelection} and it returns false on an empty frame, or in
|
||||
* a situation where allocating a new frame is impractical.
|
||||
*/
|
||||
public class FrameRowTooLargeException extends RuntimeException
|
||||
{
|
||||
private final long maxFrameSize;
|
||||
|
||||
public FrameRowTooLargeException(final long maxFrameSize)
|
||||
{
|
||||
super(StringUtils.format("Row too large to add to frame (max frame size = %,d)", maxFrameSize));
|
||||
this.maxFrameSize = maxFrameSize;
|
||||
}
|
||||
|
||||
public long getMaxFrameSize()
|
||||
{
|
||||
return maxFrameSize;
|
||||
}
|
||||
}
|
|
@ -34,9 +34,9 @@ public interface FrameWriter extends Closeable
|
|||
{
|
||||
/**
|
||||
* Write the current row to the frame that is under construction, if there is enough space to do so.
|
||||
*
|
||||
* <p>
|
||||
* If this method returns false on an empty frame, or in a situation where starting a new frame is impractical,
|
||||
* it is conventional (although not required) for the caller to throw {@link FrameRowTooLargeException}.
|
||||
* it is conventional (although not required) for the caller to throw {@link org.apache.druid.frame.processor.FrameRowTooLargeException}.
|
||||
*
|
||||
* @return true if the row was written, false if there was not enough space
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.druid.frame.FrameType;
|
|||
import org.apache.druid.frame.allocation.HeapMemoryAllocator;
|
||||
import org.apache.druid.frame.allocation.MemoryAllocator;
|
||||
import org.apache.druid.frame.key.SortColumn;
|
||||
import org.apache.druid.frame.write.FrameRowTooLargeException;
|
||||
import org.apache.druid.frame.processor.FrameRowTooLargeException;
|
||||
import org.apache.druid.frame.write.FrameWriter;
|
||||
import org.apache.druid.frame.write.FrameWriterFactory;
|
||||
import org.apache.druid.frame.write.FrameWriters;
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.frame.write;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class FrameRowTooLargeExceptionTest
|
||||
{
|
||||
@Test
|
||||
public void testBasic()
|
||||
{
|
||||
final int maxFrameSize = 1000;
|
||||
final FrameRowTooLargeException e = new FrameRowTooLargeException(maxFrameSize);
|
||||
Assert.assertEquals(maxFrameSize, e.getMaxFrameSize());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue