drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #938: DRILL-5694: Handle HashAgg OOM by spill and retry, ...
Date Sun, 10 Sep 2017 02:53:47 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/938#discussion_r137939116
  
    --- Diff: common/src/main/java/org/apache/drill/common/exceptions/RetryAfterSpillException.java
---
    @@ -0,0 +1,32 @@
    +/**
    + * 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.drill.common.exceptions;
    +
    +import org.apache.drill.exec.proto.UserBitShared;
    +
    +/**
    + *  A special exception to be caught by caller, who is supposed to free memory by spilling
and try again
    + *
    + */
    +public class RetryAfterSpillException extends UserException {
    --- End diff --
    
    If this exception is thrown and caught internally, it should not extend `UserException`.
Instead it should extend the Java `RuntimeException`.
    
    Better, since you know you must catch this, this should be a checked exception, extended
from `Exception` and declared by the method that throws it.
    
    `UserException` is purely for exceptions reported to the user.


---

Mime
View raw message