/** * Returns if a given protocol version is supported. * * @param version version number * @return true if the version is supported, else false */ public static boolean supports(CryptoProtocolVersion version) { if (version.getVersion() == UNKNOWN.getVersion()) { return false; } for (CryptoProtocolVersion v : CryptoProtocolVersion.values()) { if (v.getVersion() == version.getVersion()) { return true; } } return false; }
FsPermission.getFileDefault().applyUMask(FsPermission.getUMask(conf)), clientName, new EnumSetWritable<>(overwrite ? EnumSet.of(CREATE, OVERWRITE) : EnumSet.of(CREATE)), createParent, replication, blockSize, CryptoProtocolVersion.supported()); } catch (Exception e) { if (e instanceof RemoteException) {
if (c.equals(CryptoProtocolVersion.UNKNOWN)) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " + "client: " + c.getUnknownValue()); if (c.equals(required)) { return c; + " Client provided: " + Arrays.toString(supportedVersions) + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion .values()));
/** * Obtain the crypto protocol version from the provided FileEncryptionInfo, * checking to see if this version is supported by. * * @param feInfo FileEncryptionInfo * @return CryptoProtocolVersion from the feInfo * @throws IOException if the protocol version is unsupported. */ private static CryptoProtocolVersion getCryptoProtocolVersion (FileEncryptionInfo feInfo) throws IOException { final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion(); if (!CryptoProtocolVersion.supports(version)) { throw new IOException("Client does not support specified " + "CryptoProtocolVersion " + version.getDescription() + " version " + "number" + version.getVersion()); } return version; }
public static CryptoProtocolVersion convert(CryptoProtocolVersionProto proto) { switch(proto) { case ENCRYPTION_ZONES: return CryptoProtocolVersion.ENCRYPTION_ZONES; default: // Set to UNKNOWN and stash the unknown enum value CryptoProtocolVersion version = CryptoProtocolVersion.UNKNOWN; version.setUnknownValue(proto.getNumber()); return version; } }
if (c.equals(CryptoProtocolVersion.UNKNOWN)) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " + "client: " + c.getUnknownValue()); if (c.equals(required)) { return c; + " Client provided: " + Arrays.toString(supportedVersions) + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion .values()));
/** * Obtain the crypto protocol version from the provided FileEncryptionInfo, * checking to see if this version is supported by. * * @param feInfo FileEncryptionInfo * @return CryptoProtocolVersion from the feInfo * @throws IOException if the protocol version is unsupported. */ public static CryptoProtocolVersion getCryptoProtocolVersion( FileEncryptionInfo feInfo) throws IOException { final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion(); if (!CryptoProtocolVersion.supports(version)) { throw new IOException("Client does not support specified " + "CryptoProtocolVersion " + version.getDescription() + " version " + "number" + version.getVersion()); } return version; }
public static CryptoProtocolVersion convert(CryptoProtocolVersionProto proto) { switch(proto) { case ENCRYPTION_ZONES: return CryptoProtocolVersion.ENCRYPTION_ZONES; default: // Set to UNKNOWN and stash the unknown enum value CryptoProtocolVersion version = CryptoProtocolVersion.UNKNOWN; version.setUnknownValue(proto.getNumber()); return version; } }
/** * Returns if a given protocol version is supported. * * @param version version number * @return true if the version is supported, else false */ public static boolean supports(CryptoProtocolVersion version) { if (version.getVersion() == UNKNOWN.getVersion()) { return false; } for (CryptoProtocolVersion v : CryptoProtocolVersion.values()) { if (v.getVersion() == version.getVersion()) { return true; } } return false; }
if (c.equals(CryptoProtocolVersion.UNKNOWN)) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " + "client: " + c.getUnknownValue()); if (c.equals(required)) { return c; + " Client provided: " + Arrays.toString(supportedVersions) + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion .values()));
/** * Obtain the crypto protocol version from the provided FileEncryptionInfo, * checking to see if this version is supported by. * * @param feInfo FileEncryptionInfo * @return CryptoProtocolVersion from the feInfo * @throws IOException if the protocol version is unsupported. */ private static CryptoProtocolVersion getCryptoProtocolVersion (FileEncryptionInfo feInfo) throws IOException { final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion(); if (!CryptoProtocolVersion.supports(version)) { throw new IOException("Client does not support specified " + "CryptoProtocolVersion " + version.getDescription() + " version " + "number" + version.getVersion()); } return version; }
public static CryptoProtocolVersion convert(CryptoProtocolVersionProto proto) { switch(proto) { case ENCRYPTION_ZONES: return CryptoProtocolVersion.ENCRYPTION_ZONES; default: // Set to UNKNOWN and stash the unknown enum value CryptoProtocolVersion version = CryptoProtocolVersion.UNKNOWN; version.setUnknownValue(proto.getNumber()); return version; } }
/** * Do file create. */ @Override long executeOp(int daemonId, int inputIdx, String clientName) throws IOException { long start = Time.now(); // dummyActionNoSynch(fileIdx); clientProto.create(fileNames[daemonId][inputIdx], FsPermission.getDefault(), clientName, new EnumSetWritable<CreateFlag>(EnumSet .of(CreateFlag.CREATE, CreateFlag.OVERWRITE)), true, replication, BLOCK_SIZE, CryptoProtocolVersion.supported()); long end = Time.now(); for(boolean written = !closeUponCreate; !written; written = clientProto.complete(fileNames[daemonId][inputIdx], clientName, null, INodeId.GRANDFATHER_INODE_ID)); return end-start; }
/** * Returns if a given protocol version is supported. * * @param version version number * @return true if the version is supported, else false */ public static boolean supports(CryptoProtocolVersion version) { if (version.getVersion() == UNKNOWN.getVersion()) { return false; } for (CryptoProtocolVersion v : CryptoProtocolVersion.values()) { if (v.getVersion() == version.getVersion()) { return true; } } return false; }
clientProto.create(fileName, FsPermission.getDefault(), clientName, new EnumSetWritable<CreateFlag>(EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE)), true, replication, BLOCK_SIZE, CryptoProtocolVersion.supported()); ExtendedBlock lastBlock = addBlocks(fileName, clientName); clientProto.complete(fileName, clientName, lastBlock, INodeId.GRANDFATHER_INODE_ID);
/** * Returns if a given protocol version is supported. * * @param version version number * @return true if the version is supported, else false */ public static boolean supports(CryptoProtocolVersion version) { if (version.getVersion() == UNKNOWN.getVersion()) { return false; } for (CryptoProtocolVersion v : CryptoProtocolVersion.values()) { if (v.getVersion() == version.getVersion()) { return true; } } return false; }
/** * Returns if a given protocol version is supported. * * @param version version number * @return true if the version is supported, else false */ public static boolean supports(CryptoProtocolVersion version) { if (version.getVersion() == UNKNOWN.getVersion()) { return false; } for (CryptoProtocolVersion v : CryptoProtocolVersion.values()) { if (v.getVersion() == version.getVersion()) { return true; } } return false; }