Toggle navigation
Home
org.apache.phoenix.schema.PName to org.apache.phoenix.schema.PTable
No. of Instances - 6
No. of Commits - 1
No. of Projects - {'pheonix'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Add or Remove Method invocation
pair.getFirst().getBytes()
to
pair.getFirst().getPhysicalName().getBytes()
index.getPhysicalName()
to
table
Other
indexMutations == null ? Collections.<Mutation>emptyList() : indexMutations
to
mutationList
Cascading Type Change (Similar)
Pair<PName,List<Mutation>>
to
Pair<>
Iterator<Pair<PName,List<Mutation>>>
to
Iterator<Pair<PTable,List<Mutation>>>
Update Anonymous class
{ boolean isFirst=true; Map<byte[],List<Mutation>> indexMutationsMap=null; @Override public boolean hasNext(){ return isFirst || indexes.hasNext(); } @Override public Pair<PName,List<Mutation>> next(){ if (isFirst) { isFirst=false; return new Pair<>(table.getPhysicalName(),mutationList); } PTable index=indexes.next(); List<Mutation> indexMutations=null; try { if (!mutationsPertainingToIndex.isEmpty()) { if (table.isTransactional()) { if (indexMutationsMap == null) { PhoenixTxIndexMutationGenerator generator=PhoenixTxIndexMutationGenerator.newGenerator(connection,table,indexList,mutationsPertainingToIndex.get(0).getAttributesMap()); try (Table htable=connection.getQueryServices().getTable(table.getPhysicalName().getBytes())){ Collection<Pair<Mutation,byte[]>> allMutations=generator.getIndexUpdates(htable,mutationsPertainingToIndex.iterator()); indexMutationsMap=Maps.newTreeMap(Bytes.BYTES_COMPARATOR); for ( Pair<Mutation,byte[]> mutation : allMutations) { List<Mutation> mutations=indexMutationsMap.get(mutation.getSecond()); if (mutations == null) { mutations=Lists.newArrayList(); indexMutationsMap.put(mutation.getSecond(),mutations); } mutations.add(mutation.getFirst()); } } } indexMutations=indexMutationsMap.get(index.getPhysicalName().getBytes()); } else { indexMutations=IndexUtil.generateIndexData(table,index,values,mutationsPertainingToIndex,connection.getKeyValueBuilder(),connection); } } if (!sendAll) { TableRef key=new TableRef(index); MultiRowMutationState multiRowMutationState=mutations.remove(key); if (multiRowMutationState != null) { final List<Mutation> deleteMutations=Lists.newArrayList(); generateMutations(key,mutationTimestamp,serverTimestamp,multiRowMutationState,deleteMutations,null); if (indexMutations == null) { indexMutations=deleteMutations; } else { indexMutations.addAll(deleteMutations); } } } } catch ( SQLException|IOException e) { throw new IllegalDataException(e); } return new Pair<PName,List<Mutation>>(index.getPhysicalName(),indexMutations == null ? Collections.<Mutation>emptyList() : indexMutations); } @Override public void remove(){ throw new UnsupportedOperationException(); } }
to
{ boolean isFirst=true; Map<byte[],List<Mutation>> indexMutationsMap=null; @Override public boolean hasNext(){ return isFirst || indexes.hasNext(); } @Override public Pair<PTable,List<Mutation>> next(){ if (isFirst) { isFirst=false; return new Pair<>(table,mutationList); } PTable index=indexes.next(); List<Mutation> indexMutations=null; try { if (!mutationsPertainingToIndex.isEmpty()) { if (table.isTransactional()) { if (indexMutationsMap == null) { PhoenixTxIndexMutationGenerator generator=PhoenixTxIndexMutationGenerator.newGenerator(connection,table,indexList,mutationsPertainingToIndex.get(0).getAttributesMap()); try (Table htable=connection.getQueryServices().getTable(table.getPhysicalName().getBytes())){ Collection<Pair<Mutation,byte[]>> allMutations=generator.getIndexUpdates(htable,mutationsPertainingToIndex.iterator()); indexMutationsMap=Maps.newTreeMap(Bytes.BYTES_COMPARATOR); for ( Pair<Mutation,byte[]> mutation : allMutations) { List<Mutation> mutations=indexMutationsMap.get(mutation.getSecond()); if (mutations == null) { mutations=Lists.newArrayList(); indexMutationsMap.put(mutation.getSecond(),mutations); } mutations.add(mutation.getFirst()); } } } indexMutations=indexMutationsMap.get(index.getPhysicalName().getBytes()); } else { indexMutations=IndexUtil.generateIndexData(table,index,values,mutationsPertainingToIndex,connection.getKeyValueBuilder(),connection); } } if (!sendAll) { TableRef key=new TableRef(index); MultiRowMutationState multiRowMutationState=mutations.remove(key); if (multiRowMutationState != null) { final List<Mutation> deleteMutations=Lists.newArrayList(); generateMutations(key,mutationTimestamp,serverTimestamp,multiRowMutationState,deleteMutations,null); if (indexMutations == null) { indexMutations=deleteMutations; } else { indexMutations.addAll(deleteMutations); } } } } catch ( SQLException|IOException e) { throw new IllegalDataException(e); } return new Pair<PTable,List<Mutation>>(index,indexMutations == null ? Collections.<Mutation>emptyList() : indexMutations); } @Override public void remove(){ throw new UnsupportedOperationException(); } }