trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mashengchen <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1530]deprecated put.g...
Date Thu, 12 Nov 2015 03:16:21 GMT
Github user mashengchen commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/166#discussion_r44617837
  
    --- Diff: core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalTable.java
---
    @@ -692,22 +693,23 @@ public SsccPutMultipleTransactionalResponse call(SsccRegionService
instance) thr
     
     	}
     	
    -	// validate for well-formedness
    -	public void validatePut(final Put put) throws IllegalArgumentException {
    -		if (put.isEmpty()) {
    -			throw new IllegalArgumentException("No columns to insert");
    -		}
    -		if (maxKeyValueSize > 0) {
    -			for (List<KeyValue> list : put.getFamilyMap().values()) {
    -				for (KeyValue kv : list) {
    -					if (kv.getLength() > maxKeyValueSize) {
    -						throw new IllegalArgumentException(
    -								"KeyValue size too large");
    -					}
    -				}
    -			}
    -		}
    -	}
    +    // validate for well-formedness
    +    public void validatePut(final Put put) throws IllegalArgumentException {
    +        if (put.isEmpty()) {
    +            throw new IllegalArgumentException("No columns to insert");
    +        }
    +        if (maxKeyValueSize > 0) {
    --- End diff --
    
    yes, the code is never executed, also in KeyValue source code, it restricted the size
itself.
    but i guess the person who code here will use a constant to restricted it future, and
he(she) may be forget to add the constant.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message