Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hops 1621 #254

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion schema/create-tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_2.8.2.9_to_2.8.2.10.sql
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_2.8.2.10_to_3.2.0.0.sql &&
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_3.2.0.0_to_3.2.0.1.sql &&
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_3.2.0.1_to_3.2.0.2.sql &&
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_3.2.0.2_to_3.2.0.3.sql
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_3.2.0.2_to_3.2.0.3.sql &&
mysql --host=$1 --port=$2 -u $3 -p$4 $5 < update-schema_3.2.0.3_to_3.2.0.4.sql

3 changes: 3 additions & 0 deletions schema/update-schema_3.2.0.3_to_3.2.0.4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE hdfs_xattrs MODIFY value VARBINARY(29500);

ALTER TABLE hdfs_file_provenance_xattrs_buffer MODIFY value VARBINARY(29500);
13 changes: 10 additions & 3 deletions src/main/java/io/hops/metadata/ndb/dalimpl/hdfs/XAttrClusterJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public void prepare(Collection<StoredXAttr> removed, Collection<StoredXAttr> new
deletions.addAll(xdeletions);
changes.addAll(persistables);
}

session.deletePersistentAll(deletions);
session.savePersistentAll(changes);
}finally {
Expand Down Expand Up @@ -295,11 +294,19 @@ private StoredXAttr convert(HopsSession session, List<XAttrDTO> dtos)
for(XAttrDTO dto : dtos){
if(dto.getNumParts() != NON_EXISTS_XATTR){
values[index] = dto.getValue();
if(dto.getNumParts() != dtos.size()){
throw new IllegalStateException("Failed to read XAttr [ " + dto.getName()
+ " ] for Inode " + dto.getINodeId() +"."+
" Parts expected: "+dto.getNumParts()+" Parts read: " + dtos.size());
}
}else{
XAttrDTO partDto = session.find(XAttrDTO.class,
new Object[]{dto.getINodeId(), dto.getNamespace(),
dto.getName(), index});
values[index] = partDto.getValue();
if(partDto != null) {
values[index] = partDto.getValue();
session.release(partDto);
}
}
if(values[index] == null){
nulls++;
Expand All @@ -321,7 +328,7 @@ private StoredXAttr convert(HopsSession session, List<XAttrDTO> dtos)
}

return new StoredXAttr(dto.getINodeId(), dto.getNamespace(),
dto.getName(), value);
dto.getName(), value, dto.getNumParts());
}

}