- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.fs.XAttr.getValue()
方法的一些代码示例,展示了XAttr.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAttr.getValue()
方法的具体详情如下:
包路径:org.apache.hadoop.fs.XAttr
类名称:XAttr
方法名:getValue
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
private static Map toJsonMap(final XAttr xAttr, final XAttrCodec encoding) throws IOException { if (xAttr == null) { return null; } final Map m = new TreeMap(); m.put("name", XAttrHelper.getPrefixedName(xAttr)); m.put("value", xAttr.getValue() != null ? XAttrCodec.encodeValue(xAttr.getValue(), encoding) : null); return m; }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
public XAttrFeature(List xAttrs) { if (xAttrs != null && !xAttrs.isEmpty()) { List toPack = new ArrayList(); ImmutableList.Builder b = null; for (XAttr attr : xAttrs) { if (attr.getValue() == null || attr.getValue().length <= PACK_THRESHOLD) { toPack.add(attr); } else { if (b == null) { b = ImmutableList.builder(); } b.add(attr); } } this.attrs = XAttrFormat.toBytes(toPack); if (b != null) { this.xAttrs = b.build(); } } }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
int vlen = a.getValue() == null ? 0 : a.getValue().length; Preconditions.checkArgument(vlen < XATTR_VALUE_LEN_MAX, "The length of xAttr values is too long."); out.write((byte)(vlen)); if (vlen > 0) { out.write(a.getValue());
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
@Override public byte getLocalStoragePolicyID() { XAttrFeature f = getXAttrFeature(); XAttr xattr = f == null ? null : f.getXAttr( BlockStoragePolicySuite.getStoragePolicyXAttrPrefixedName()); if (xattr != null) { return (xattr.getValue())[0]; } return BLOCK_STORAGE_POLICY_ID_UNSPECIFIED; }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
private static void appendXAttrsToXml(ContentHandler contentHandler, List xAttrs) throws SAXException { for (XAttr xAttr: xAttrs) { contentHandler.startElement("", "", "XATTR", new AttributesImpl()); XMLUtils.addSaxString(contentHandler, "NAMESPACE", xAttr.getNameSpace().toString()); XMLUtils.addSaxString(contentHandler, "NAME", xAttr.getName()); if (xAttr.getValue() != null) { try { XMLUtils.addSaxString(contentHandler, "VALUE", XAttrCodec.encodeValue(xAttr.getValue(), XAttrCodec.HEX)); } catch (IOException e) { throw new SAXException(e); } } contentHandler.endElement("", "", "XATTR"); } }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
/** * Verifies that the combined size of the name and value of an xattr is within * the configured limit. Setting a limit of zero disables this check. */ private static void checkXAttrSize(FSDirectory fsd, XAttr xAttr) { int size = DFSUtil.string2Bytes(xAttr.getName()).length; if (xAttr.getValue() != null) { size += xAttr.getValue().length; } if (size > fsd.getXattrMaxSize()) { throw new HadoopIllegalArgumentException( "The XAttr is too big. The maximum combined size of the" + " name and value is " + fsd.getXattrMaxSize() + ", but the total size is " + size); } }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
private static ZoneEncryptionInfoProto getZoneEncryptionInfoProto( final INodesInPath iip) throws IOException { final XAttr fileXAttr = FSDirXAttrOp.unprotectedGetXAttrByPrefixedName( iip.getLastINode(), iip.getPathSnapshotId(), CRYPTO_XATTR_ENCRYPTION_ZONE); if (fileXAttr == null) { throw new IOException( "Could not find reencryption XAttr for file " + iip.getPath()); } try { return ZoneEncryptionInfoProto.parseFrom(fileXAttr.getValue()); } catch (InvalidProtocolBufferException e) { throw new IOException( "Could not parse file encryption info for " + "inode " + iip .getPath(), e); } }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
private static XAttrFeatureProto.Builder buildXAttrs(XAttrFeature f) { XAttrFeatureProto.Builder b = XAttrFeatureProto.newBuilder(); for (XAttr a : f.getXAttrs()) { XAttrCompactProto.Builder xAttrCompactBuilder = XAttrCompactProto. newBuilder(); int v = XAttrFormat.toInt(a); xAttrCompactBuilder.setName(v); if (a.getValue() != null) { xAttrCompactBuilder.setValue(PBHelperClient.getByteString(a.getValue())); } b.addXAttrs(xAttrCompactBuilder.build()); } return b; }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
static void checkPermissionForApi(FSPermissionChecker pc, XAttr xAttr, boolean isRawPath) throws AccessControlException { final boolean isSuperUser = pc.isSuperUser(); if (xAttr.getNameSpace() == XAttr.NameSpace.USER || (xAttr.getNameSpace() == XAttr.NameSpace.TRUSTED && isSuperUser)) { return; } if (xAttr.getNameSpace() == XAttr.NameSpace.RAW && isRawPath) { return; } if (XAttrHelper.getPrefixedName(xAttr). equals(SECURITY_XATTR_UNREADABLE_BY_SUPERUSER)) { if (xAttr.getValue() != null) { throw new AccessControlException("Attempt to set a value for '" + SECURITY_XATTR_UNREADABLE_BY_SUPERUSER + "'. Values are not allowed for this xattr."); } return; } throw new AccessControlException("User doesn't have permission for xattr: " + XAttrHelper.getPrefixedName(xAttr)); }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
HdfsProtos.PerFileEncryptionInfoProto fileProto = HdfsProtos.PerFileEncryptionInfoProto.parseFrom( fileXAttr.getValue()); return PBHelperClient.convert(fileProto, suite, version, keyName); } catch (InvalidProtocolBufferException e) {
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
XAttr xattr = xaf.getXAttr(XATTR_ERASURECODING_POLICY); if (xattr != null) { ByteArrayInputStream bIn = new ByteArrayInputStream(xattr.getValue()); DataInputStream dIn = new DataInputStream(bIn); String ecPolicyName = WritableUtils.readString(dIn);
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
try { final HdfsProtos.ZoneEncryptionInfoProto ezProto = HdfsProtos.ZoneEncryptionInfoProto.parseFrom(xAttr.getValue()); return new EncryptionZoneInt( inode.getId(), PBHelperClient.convert(ezProto.getSuite()),
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
HdfsProtos.ZoneEncryptionInfoProto.parseFrom(xattr.getValue()); fsd.ezManager.addEncryptionZone(inode.getId(), PBHelperClient.convert(ezProto.getSuite()),
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
if (xattr != null) { ByteArrayInputStream bins = new ByteArrayInputStream(xattr.getValue()); DataInputStream din = new DataInputStream(bins); String ecPolicyName = WritableUtils.readString(din);
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs
private void addEncryptionZone(INodeWithAdditionalFields inode, XAttrFeature xaf) { if (xaf == null) { return; } XAttr xattr = xaf.getXAttr(CRYPTO_XATTR_ENCRYPTION_ZONE); if (xattr == null) { return; } try { final HdfsProtos.ZoneEncryptionInfoProto ezProto = HdfsProtos.ZoneEncryptionInfoProto.parseFrom(xattr.getValue()); ezManager.unprotectedAddEncryptionZone(inode.getId(), PBHelperClient.convert(ezProto.getSuite()), PBHelperClient.convert(ezProto.getCryptoProtocolVersion()), ezProto.getKeyName()); if (ezProto.hasReencryptionProto()) { final ReencryptionInfoProto reProto = ezProto.getReencryptionProto(); // inodes parents may not be loaded if this is done during fsimage // loading so cannot set full path now. Pass in null to indicate that. ezManager.getReencryptionStatus() .updateZoneStatus(inode.getId(), null, reProto); } } catch (InvalidProtocolBufferException e) { NameNode.LOG.warn("Error parsing protocol buffer of " + "EZ XAttr " + xattr.getName() + " dir:" + inode.getFullPathName()); } }
代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs
private static Map toJsonMap(final XAttr xAttr, final XAttrCodec encoding) throws IOException { if (xAttr == null) { return null; } final Map m = new TreeMap(); m.put("name", XAttrHelper.getPrefixName(xAttr)); m.put("value", xAttr.getValue() != null ? XAttrCodec.encodeValue(xAttr.getValue(), encoding) : null); return m; }
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
@Override public byte getLocalStoragePolicyID() { XAttrFeature f = getXAttrFeature(); ImmutableList xattrs = f == null ? ImmutableList. of() : f .getXAttrs(); for (XAttr xattr : xattrs) { if (BlockStoragePolicySuite.isStoragePolicyXAttr(xattr)) { return (xattr.getValue())[0]; } } return ID_UNSPECIFIED; }
代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs
public static XAttrProto convertXAttrProto(XAttr a) { XAttrProto.Builder builder = XAttrProto.newBuilder(); builder.setNamespace(convert(a.getNameSpace())); if (a.getName() != null) { builder.setName(a.getName()); } if (a.getValue() != null) { builder.setValue(getByteString(a.getValue())); } return builder.build(); }
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-client
public static XAttrProto convertXAttrProto(XAttr a) { XAttrProto.Builder builder = XAttrProto.newBuilder(); builder.setNamespace(convert(a.getNameSpace())); if (a.getName() != null) { builder.setName(a.getName()); } if (a.getValue() != null) { builder.setValue(getByteString(a.getValue())); } return builder.build(); }
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
public static XAttrProto convertXAttrProto(XAttr a) { XAttrProto.Builder builder = XAttrProto.newBuilder(); builder.setNamespace(convert(a.getNameSpace())); if (a.getName() != null) { builder.setName(a.getName()); } if (a.getValue() != null) { builder.setValue(getByteString(a.getValue())); } return builder.build(); }
Tôi đang cố gắng sử dụng xattr trên một trang web để lưu trữ một số siêu dữ liệu trong tệp .txt rồi tải xuống. Nếu tôi sử dụng xattr_set của PHP trên một tệp tạm thời khi chạy trang web cục bộ, thì xattr_list và
Tôi đang cố gắng thực hiện một số thử nghiệm với XATTR. Tôi đã biên dịch lại kernel của mình với tất cả XATTR được bật. Bây giờ, khi tôi bao gồm tiêu đề của xattrs: #include tôi nhận được thông báo lỗi không có tệp nào như vậy
Tôi đã viết một tập lệnh sử dụng mô-đun xattr để thiết lập các thuộc tính mở rộng trên một số tệp. Tôi đã thử nghiệm thành công bằng python3 trên Ubuntu, nhưng nó không hoạt động trên RasperryPi của tôi. Tôi đã phải thay đổi nhiều lỗi nhỏ, chủ yếu là x
Tôi đang cố gắng viết một tập lệnh sử dụng xattr để trích xuất URL tải xuống gốc từ các ảnh đĩa được tải xuống bằng Safari trên OS X, để tôi có thể đổi tên chúng nhưng vẫn dễ dàng lấy được tên gốc để tham khảo. Lệnh này in ra tập tin đã cho.
Tôi đang chạy lệnh sau để thiết lập các thuộc tính mở rộng nhưng nó trả về lỗi Không thể thiết lập các thuộc tính mở rộng. Lỗi thao tác không được hỗ trợ. xattr thiết lập bảo mật.SMACK64 "*" /dev/null xattr thiết lập bảo mật.S
Tôi muốn sử dụng xattr để lưu trữ một số siêu dữ liệu trực tiếp trên các tệp của mình. Về cơ bản, đây là các thẻ tôi sử dụng để phân loại tệp khi tìm kiếm tệp. Mục tiêu của tôi là mở rộng các thẻ Mac OS X thông thường bằng cách liên kết nhiều thông tin hơn với mỗi thẻ, chẳng hạn như ngày thẻ được thêm vào
Từ man fsync(2) nó sẽ đồng bộ siêu dữ liệu của tệp, tôi nghĩ đó là danh sách trong stat. xattr là gì đối với một tập tin? Nó có thuộc về siêu dữ liệu không? Chúng tôi đã thực hiện một thử nghiệm, viết một tệp, thiết lập 6 xattrs, sau đó thực hiện fsyn
Tôi nghĩ rằng có những thuộc tính tệp mở rộng trong NTFS mà Windows hỗ trợ. Tôi không tìm thấy lệnh để truy cập/cập nhật thuộc tính. Có phiên bản Windows (và hệ thống tập tin) nào hỗ trợ chức năng này không? Tôi đã thử getfattr, setfattr
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.equalsIgnoreValue() trong Java và cho thấy cách sử dụng cụ thể của XAttr.equalsIgnoreValue().
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.getValue() trong Java và cho thấy cách sử dụng cụ thể của XAttr.getValue(). Những ví dụ mã này chủ yếu từ Github/
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.equals() trong Java và cho thấy cách sử dụng cụ thể của XAttr.equals(). Những ví dụ mã này chủ yếu từ Github/Stac
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.() trong Java và trình bày cách sử dụng cụ thể của XAttr.(). Những ví dụ mã này chủ yếu đến từ Github/Stackoverflow/Ma
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.getName() trong Java và trình bày cách sử dụng cụ thể của XAttr.getName(). Những ví dụ mã này chủ yếu đến từ Github/St
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.getNameSpace() trong Java và trình bày cách sử dụng cụ thể của XAttr.getNameSpace(). Những ví dụ mã này chủ yếu có nguồn gốc từ
Bài viết này tóm tắt một số ví dụ mã của phương thức org.apache.hadoop.fs.XAttr.hashCode() trong Java và cho thấy cách sử dụng cụ thể của XAttr.hashCode(). Những ví dụ mã này chủ yếu từ Github/
Tôi đang sử dụng lệnh setxattr để xem thuộc tính tệp mở rộng của tệp iOS và Mac. Theo tôi hiểu thì tôi có thể lưu trữ dữ liệu tùy ý ở đó, lên tới 128kb. Làm thế nào tôi có thể viết và đọc các thuộc tính mở rộng như tôi làm với một từ điển, thay vì hủy tham chiếu một con trỏ chuỗi?
Tôi đang đưa dữ liệu nhị phân vào Couchbase. Nhưng đối với trường hợp sử dụng mới của tôi, tôi cần có một trường trong tài liệu của mình có tên là created_date. Tôi đang nghĩ đến việc sử dụng xattr cho việc này. Trường này "created_date"
Hôm nọ tôi đang làm việc với một số tệp có thuộc tính mở rộng là com.apple.quarantine. Tôi biết nó dùng để làm gì, nhưng tôi luôn tò mò về ý nghĩa của thuộc tính bên dưới khi bạn xuất giá trị của nó. Ví dụ. Khi tôi gõ xattr -p com.a
Khi sắp xếp lại hình ảnh của mình theo OSX Mavericks, tôi đang viết một tập lệnh để chèn thẻ vào trường xattr của tệp hình ảnh để tôi có thể tìm kiếm chúng bằng Spotlight. (Để an toàn, tôi cũng đang chỉnh sửa
Hôm nay tôi đã thử cài đặt Hadoop trên Mac OS X Lion theo hướng dẫn tại Thiết lập Hadoop 2.4 và Pig 0.12 trên OSX cục bộ. Tôi đã thiết lập JAVA_ đúng cách
Tôi là một lập trình viên xuất sắc, rất giỏi!