You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "dean (JIRA)" <ji...@apache.org> on 2018/01/24 12:06:00 UTC

[jira] [Commented] (IGNITE-7338) can get value by entry.getValue but cann't get value by cache.get(entry.getKey)

    [ https://issues.apache.org/jira/browse/IGNITE-7338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16337470#comment-16337470 ] 

dean commented on IGNITE-7338:
------------------------------

@[~andrey-kuznetsov]  i have resolve this problem by rewrite the hashcode method in this way:

@Override
 public int hashCode() {
 int result = fileType.hashCode();
 result = (result << 5) - result + sourceType.hashCode();
 return result;
 }

 

thanks all

 

> can get value by entry.getValue but cann't get value by cache.get(entry.getKey)
> -------------------------------------------------------------------------------
>
>                 Key: IGNITE-7338
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7338
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 1.9
>            Reporter: dean
>            Priority: Critical
>
> bossapp@Linux-Power-NB-AltiDB2-XT:/home/bossapp6$java -version
> java version "1.7.0"
> Java(TM) SE Runtime Environment (build pxp6470_27sr4fp15-20171116_01(SR4 FP15))
> IBM J9 VM (build 2.7, JRE 1.7.0 Linux ppc64-64 Compressed References 20171011_366929 (JIT enabled, AOT enabled)
> J9VM - R27_Java727_SR4_20171011_1720_B366929
> JIT  - tr.r13.java_20171011_366929
> GC   - R27_Java727_SR4_20171011_1720_B366929_CMPRSS
> J9CL - 20171011_366929)
> JCL - 20171109_01 based on Oracle jdk7u161-b13
> bossapp@Linux-Power-NB-AltiDB2-XT:/home/bossapp6$lsb_release -a
> LSB Version:	:core-4.0-noarch:core-4.0-ppc64:graphics-4.0-noarch:graphics-4.0-ppc64:printing-4.0-noarch:printing-4.0-ppc64
> Distributor ID:	n/a
> Description:	redhat-4 
> Release:	n/a
> Codename:	n/a
> {color:#d04437}test code:{color}
> if(cacheName.equalsIgnoreCase("tariff-ccb_cdr_charge_rule")){
>     CcbCdrChargeRuleKey ccbCdrChargeRuleKey = new CcbCdrChargeRuleKey();
>     ccbCdrChargeRuleKey.setFileType("573");
>     ccbCdrChargeRuleKey.setSourceType("5");
>     Object cacheDate = ignite.cache(cacheName).get(ccbCdrChargeRuleKey);
>     logger.debug(LogProperty.LOGTYPE_DETAIL, ccbCdrChargeRuleKey+"Object eKey:" + cacheDate );
>     ccbCdrChargeRuleKey.setFileType("1233");
>     ccbCdrChargeRuleKey.setSourceType("14");
>     Object cacheDate1 = ignite.cache(cacheName).get(ccbCdrChargeRuleKey);
>     logger.debug(LogProperty.LOGTYPE_DETAIL, "Object1:" + cacheDate1      +"ccbCdrChargeRuleKey"+ccbCdrChargeRuleKey.hashCode());
>     IgniteCache<Object, Object> cacheDate3 = ignite.cache(cacheName);
>     for (Cache.Entry<Object, Object> e : cacheDate3) {	
>          List<ICacheModel> cacheModelList = (List<ICacheModel>) cacheDate3.get(e.getKey());
>         {color:#d04437}logger.debug(LogProperty.LOGTYPE_DETAIL,"e.getKey():"+e.getKey() +" cacheModelList:" + cacheModelList );
>         logger.debug(LogProperty.LOGTYPE_DETAIL,"e.getValue():"+e.getValue() );{color}
>    }
> }
> results:
> 2017-12-2819:17:36,322||DEBUG||frame_thread_nodestart| com.newland.boss.cloud.commons.igniteclient.PlatformInitIgniteClient.test(PlatformInitIgniteClient.java:337)| ||||||||||||{color:#d04437}e.getKey():573,5 cacheModelList:null{color}
> 2017-12-2819:17:36,323||DEBUG||frame_thread_nodestart| com.newland.boss.cloud.commons.igniteclient.PlatformInitIgniteClient.test(PlatformInitIgniteClient.java:338)| ||||||||||||{color:#d04437}e.getValue():[CcbCdrChargeRule{ccbCdrChargeRuleKey=573,5, bizDomainCode='3', conditionGroupId=999999999999, fileType='573', preProcessUnitClass='PreProcessGprs', priority=1, rateItemTypes='6', ratingClass='RatingGprs', ruleDesc='国际出访GPRS 专网', sourceType='5', userTariffClass='GetUserTariffInfoGprs', version='0.0.1'}]{color}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)