Skip to content

Commit

Permalink
load all
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaiman committed Apr 25, 2016
1 parent ad0e755 commit 8b00a3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/codec/MapLoadGivenKeysCodec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* tslint:disable */
import ClientMessage = require('../ClientMessage');
import ImmutableLazyDataList = require('./ImmutableLazyDataList');
import {BitsUtil} from '../BitsUtil';
import Address = require('../Address');
import {AddressCodec} from './AddressCodec';
import {MemberCodec} from './MemberCodec';
import {Data} from '../serialization/Data';
import {EntryViewCodec} from './EntryViewCodec';
import DistributedObjectInfoCodec = require('./DistributedObjectInfoCodec');
import {MapMessageType} from './MapMessageType';

var REQUEST_TYPE = MapMessageType.MAP_LOADGIVENKEYS;
Expand All @@ -23,7 +23,7 @@ export class MapLoadGivenKeysCodec {
dataSize += BitsUtil.calculateSizeString(name);
dataSize += BitsUtil.INT_SIZE_IN_BYTES;

keys.foreach((keysItem:any) => {
keys.forEach((keysItem:any) => {
dataSize += BitsUtil.calculateSizeData(keysItem);
});
dataSize += BitsUtil.BOOLEAN_SIZE_IN_BYTES;
Expand All @@ -38,7 +38,7 @@ export class MapLoadGivenKeysCodec {
clientMessage.appendString(name);
clientMessage.appendInt32(keys.length);

keys.foreach((keysItem:any) => {
keys.forEach((keysItem:any) => {
clientMessage.appendData(keysItem);
});

Expand Down
5 changes: 4 additions & 1 deletion src/proxy/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {MapReplaceCodec} from '../codec/MapReplaceCodec';
import {MapReplaceIfSameCodec} from '../codec/MapReplaceIfSameCodec';
import {MapSetCodec} from '../codec/MapSetCodec';
import {MapValuesCodec} from '../codec/MapValuesCodec';
import {MapLoadGivenKeysCodec} from '../codec/MapLoadGivenKeysCodec';
export class Map<K, V> extends BaseProxy implements IMap<K, V> {
containsKey(key: K): Q.Promise<boolean> {
var keyData = this.toData(key);
Expand Down Expand Up @@ -174,7 +175,9 @@ export class Map<K, V> extends BaseProxy implements IMap<K, V> {
if (keys == null) {
return this.encodeInvokeOnRandomTarget<void>(MapLoadAllCodec, replaceExistingValues);
} else {
//TODO MapLoadGivenKeysCodec
var toData = this.toData.bind(this);
var keysData: Data[] = keys.map<Data>(toData);
return this.encodeInvokeOnRandomTarget<void>(MapLoadGivenKeysCodec, keysData, replaceExistingValues);
}
}

Expand Down

0 comments on commit 8b00a3e

Please sign in to comment.