id
stringlengths
7
14
text
stringlengths
1
106k
206437_54
@Override public boolean equals( Object obj ) { // Short circuit if ( this == obj ) { return true; } Entry other; if ( obj instanceof ClonedServerEntry ) { other = ( ( ClonedServerEntry ) obj ).getClonedEntry(); } else if ( obj instanceof Entry ) { other =...
206437_55
@Override public int hashCode() { return 703; }
206437_56
@Override public int hashCode() { return 703; }
206437_57
@Override public int hashCode() { return 703; }
206437_58
@Override public boolean equals( Object obj ) { // Short circuit if ( this == obj ) { return true; } Entry other; if ( obj instanceof ClonedServerEntry ) { other = ( ( ClonedServerEntry ) obj ).getClonedEntry(); } else if ( obj instanceof Entry ) { other =...
206437_59
public static Map<EncryptionType, EncryptionKey> getRandomKeys() throws KerberosException { return getRandomKeys( DEFAULT_CIPHERS.keySet() ); }
206437_60
public static Map<EncryptionType, EncryptionKey> getRandomKeys() throws KerberosException { return getRandomKeys( DEFAULT_CIPHERS.keySet() ); }
206437_61
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException { LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage ); EncryptionEngine engine = getEngine( key ); return engine.getDecryptedData( key, data, usage ); }
206437_62
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException { LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage ); EncryptionEngine engine = getEngine( key ); return engine.getDecryptedData( key, data, usage ); }
206437_63
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException { LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage ); EncryptionEngine engine = getEngine( key ); return engine.getDecryptedData( key, data, usage ); }
206437_64
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException { LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage ); EncryptionEngine engine = getEngine( key ); return engine.getDecryptedData( key, data, usage ); }
206437_65
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException { LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage ); EncryptionEngine engine = getEngine( key ); return engine.getDecryptedData( key, data, usage ); }
206437_66
public byte[] getKey( String passPhrase ) { return generateKey( passPhrase ); }
206437_67
public byte[] getKey( String passPhrase ) { return generateKey( passPhrase ); }
206437_68
protected static byte[] sum( byte[] n1, byte[] n2, int len ) { int numOfBytes = ( len - 1 ) / 8 + 1; byte[] out = new byte[numOfBytes]; int carry = 0; for ( int i = len - 1; i > -1; i-- ) { int n1b = getBit( n1, i ); int n2b = getBit( n2, i ); int sum = n1b + n2b + carry; ...
206437_69
protected byte[] setParity( byte[] in ) { byte[] expandedIn = new byte[8]; System.arraycopy( in, 0, expandedIn, 0, in.length ); setBit( expandedIn, 62, getBit( in, 7 ) ); setBit( expandedIn, 61, getBit( in, 15 ) ); setBit( expandedIn, 60, getBit( in, 23 ) ); setBit( expandedIn, 59, getBit( in, 3...
206437_70
protected byte[] randomToKey( byte[] seed ) { int kBytes = 24; byte[] result = new byte[kBytes]; byte[] fillingKey = Strings.EMPTY_BYTES; int pos = 0; for ( int i = 0; i < kBytes; i++ ) { if ( pos < fillingKey.length ) { result[i] = fillingKey[pos]; pos++;...
206437_71
protected byte[] randomToKey( byte[] seed ) { int kBytes = 24; byte[] result = new byte[kBytes]; byte[] fillingKey = Strings.EMPTY_BYTES; int pos = 0; for ( int i = 0; i < kBytes; i++ ) { if ( pos < fillingKey.length ) { result[i] = fillingKey[pos]; pos++;...
206437_72
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_73
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_74
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_75
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_76
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_77
public static Map<EncryptionType, EncryptionKey> getKerberosKeys( String principalName, String passPhrase ) { return getKerberosKeys( principalName, passPhrase, DEFAULT_CIPHERS.keySet() ); }
206437_78
@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof NtpTimeStamp ) ) { return false; } NtpTimeStamp that = ( NtpTimeStamp ) o; return ( this.seconds == that.seconds ) && ( this.fraction == that.fraction ); }
206437_79
@Override public int hashCode() { int hash = 37; hash = hash * 17 + Long.valueOf( seconds ).hashCode(); hash = hash * 17 + Long.valueOf( fraction ).hashCode(); return hash; }
206437_80
@Override public int hashCode() { int hash = 37; hash = hash * 17 + Long.valueOf( seconds ).hashCode(); hash = hash * 17 + Long.valueOf( fraction ).hashCode(); return hash; }
206437_81
@Override public int hashCode() { int hash = 37; hash = hash * 17 + Long.valueOf( seconds ).hashCode(); hash = hash * 17 + Long.valueOf( fraction ).hashCode(); return hash; }
206437_82
@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof NtpTimeStamp ) ) { return false; } NtpTimeStamp that = ( NtpTimeStamp ) o; return ( this.seconds == that.seconds ) && ( this.fraction == that.fraction ); }
206437_83
public static LdapJndiProperties getLdapJndiProperties( Hashtable env ) throws NamingException { if ( env == null ) { throw new ConfigurationException( "environment cannot be null" ); } LdapJndiProperties props = new LdapJndiProperties(); Object principal = env.get( Context.SECURITY_PRINCIPA...
206437_84
public static LdapJndiProperties getLdapJndiProperties( Hashtable env ) throws NamingException { if ( env == null ) { throw new ConfigurationException( "environment cannot be null" ); } LdapJndiProperties props = new LdapJndiProperties(); Object principal = env.get( Context.SECURITY_PRINCIPA...
206437_85
public static LdapJndiProperties getLdapJndiProperties( Hashtable env ) throws NamingException { if ( env == null ) { throw new ConfigurationException( "environment cannot be null" ); } LdapJndiProperties props = new LdapJndiProperties(); Object principal = env.get( Context.SECURITY_PRINCIPA...
206437_86
public static X509Certificate generateSelfSignedCertificate( X500Name issuer, KeyPair keyPair, int days, String algoStr ) throws CertificateException, IOException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { // Create the certificate info X509CertInfo info ...
206437_87
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_88
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_89
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_90
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_91
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_92
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().size() <= 1 ) { return aciContext.getAciTuples(); } Collection<ACITuple> filteredTuples = new ArrayList<>(); // If the protec...
206437_93
public String getName() { return name; }
206437_94
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206437_95
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206437_96
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206437_97
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206437_98
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206437_99
@Override public Collection<ACITuple> filter( AciContext aciContext, OperationScope scope, Entry userEntry ) throws LdapException { if ( aciContext.getAciTuples().isEmpty() ) { return aciContext.getAciTuples(); } for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext();...
206444_10
@VisibleForTesting static RuntimeException convertToSerializableSparkException(Throwable error) { RuntimeException serializableThrowable = new RuntimeException( error.getClass().getName() + ": " + Objects.toString(error.getMessage(), ""), error.getCause() == null ? null : convertToSerializableSpar...
206444_11
@VisibleForTesting static RuntimeException convertToSerializableSparkException(Throwable error) { RuntimeException serializableThrowable = new RuntimeException( error.getClass().getName() + ": " + Objects.toString(error.getMessage(), ""), error.getCause() == null ? null : convertToSerializableSpar...
206444_12
public abstract void createTableLike(String dbName, String existingTblName, sts, boolean isExternal, ;
206444_13
public abstract void renameTable(String dbName, String oldName, ;
206444_14
public abstract void updateTableSchema(String dbName, String tableName, List<HCatFieldSchema> columnSchema) ;
206444_15
;
206444_16
public static ReplicationTask create(HCatClient client, HCatNotificationEvent event){ if (event == null){ throw new IllegalArgumentException("event should not be null"); } return getFactoryInstance(client).create(client,event); }
206444_17
public static boolean isset(String s) { return (s != null) && (s.length() > 0); }
206444_18
public static boolean isset(String s) { return (s != null) && (s.length() > 0); }
206444_19
public static String extractPercentComplete(String line) { Matcher jar = JAR_COMPLETE.matcher(line); if (jar.find()) return jar.group().trim(); Matcher pig = PIG_COMPLETE.matcher(line); if (pig.find()) return pig.group().trim(); Matcher beeline = HIVE_BEELINE_COMPLETE.matcher(line); if (beeline.find...
206444_20
public static String encodeArray(String[] plain) { if (plain == null) return null; String[] escaped = new String[plain.length]; for (int i = 0; i < plain.length; ++i) { if (plain[i] == null) { plain[i] = ""; } escaped[i] = StringUtils.escapeString(plain[i]); } return StringUtils.arrayToS...
206444_21
public static String[] decodeArray(String s) { if (s == null) return null; String[] escaped = StringUtils.split(s); String[] plain = new String[escaped.length]; for (int i = 0; i < escaped.length; ++i) plain[i] = StringUtils.unEscapeString(escaped[i]); return plain; }
206444_22
public static Path hadoopFsPath(String fname, final Configuration conf, String user) throws URISyntaxException, IOException, InterruptedException { if (fname == null || conf == null) { return null; } UserGroupInformation ugi; if (user!=null) { ugi = UgiFactory.getUgi(user); } else { ugi = UserGr...
206444_23
public static String hadoopFsFilename(String fname, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { Path p = hadoopFsPath(fname, conf, user); if (p == null) return null; else return p.toString(); }
206444_24
public static String[] hadoopFsListAsArray(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } String[] dirty = files.split(","); String[] clean = n...
206444_25
public static String hadoopFsListAsString(String files, Configuration conf, String user) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException { if (files == null || conf == null) { return null; } return StringUtils.arrayToString(hadoopFsListAsArray(file...
206444_26
public static String addUserHomeDirectoryIfApplicable(String origPathStr, String user) throws IOException, URISyntaxException { if(origPathStr == null || origPathStr.isEmpty()) { return "/user/" + user; } Path p = new Path(origPathStr); if(p.isAbsolute()) { return origPathStr; } if(p.toUri().getPa...
206444_27
public static String unEscapeString(String s) { return s != null && s.contains("\\,") ? StringUtils.unEscapeString(s) : s; }
206444_28
public static String findContainingJar(Class<?> clazz, String fileNamePattern) { ClassLoader loader = clazz.getClassLoader(); String classFile = clazz.getName().replaceAll("\\.", "/") + ".class"; try { for(final Enumeration<URL> itr = loader.getResources(classFile); itr.hasMoreElements();) { fin...
206444_29
;
206444_30
;
206444_31
;
206444_32
;
206444_33
@GET @Path("status") @Produces({MediaType.APPLICATION_JSON}) public Map<String, String> status() { return STATUS_OK; }
206444_34
@GET @Path("version") @Produces({MediaType.APPLICATION_JSON}) public Map<String, Object> version() { return SUPPORTED_VERSIONS; }
206444_35
@GET @Produces({MediaType.APPLICATION_JSON}) public Map<String, Object> requestFormats() { return SUPPORTED_FORMATS; }
206444_36
public void verifyPropertyParam(String param, String name) throws BadParam { verifyParam(param, name); Matcher m = PROPERTY_ID.matcher(param); if (!m.matches()) { throw new BadParam("Invalid property name " + name); } }
206444_37
protected static ResourceSchema getBagSubSchema(HCatFieldSchema hfs) throws IOException { // there are two cases - array<Type> and array<struct<...>> // in either case the element type of the array is represented in a // tuple field schema in the bag's field schema - the second case (struct) // more naturally t...
206444_38
protected static ResourceSchema getBagSubSchema(HCatFieldSchema hfs) throws IOException { // there are two cases - array<Type> and array<struct<...>> // in either case the element type of the array is represented in a // tuple field schema in the bag's field schema - the second case (struct) // more naturally t...
206444_39
@Override public Object deserialize(Writable blob) throws SerDeException { try { List<?> row = (List<?>) jsonSerde.deserialize(blob); List<Object> fatRow = fatLand(row); return new DefaultHCatRecord(fatRow); } catch (Exception e) { throw new SerDeException(e); } }
206444_40
@Override public Object deserialize(Writable blob) throws SerDeException { try { List<?> row = (List<?>) jsonSerde.deserialize(blob); List<Object> fatRow = fatLand(row); return new DefaultHCatRecord(fatRow); } catch (Exception e) { throw new SerDeException(e); } }
206444_41
@Override public Object deserialize(Writable blob) throws SerDeException { try { List<?> row = (List<?>) jsonSerde.deserialize(blob); List<Object> fatRow = fatLand(row); return new DefaultHCatRecord(fatRow); } catch (Exception e) { throw new SerDeException(e); } }
206444_42
@Override public int size() { return contents.size(); }
206444_43
@Override public int size() { return contents.size(); }
206444_44
@Override public int size() { return contents.size(); }
206444_45
public static HCatSchema getHCatSchemaFromTypeString(String typeString) throws HCatException { return getHCatSchema(TypeInfoUtils.getTypeInfoFromTypeString(typeString)); }
206444_46
public static HCatFieldSchema getHCatFieldSchema(FieldSchema fs) throws HCatException { String fieldName = fs.getName(); TypeInfo baseTypeInfo = TypeInfoUtils.getTypeInfoFromTypeString(fs.getType()); return getHCatFieldSchema(fieldName, baseTypeInfo, fs.getComment()); }
206444_47
@Override public Object get(int fieldNum) { try { StructField fref = soi.getAllStructFieldRefs().get(fieldNum); return HCatRecordSerDe.serializeField( soi.getStructFieldData(wrappedObject, fref), fref.getFieldObjectInspector()); } catch (SerDeException e) { throw new IllegalStateException(...
206444_48
@Override public Object get(int fieldNum) { try { StructField fref = soi.getAllStructFieldRefs().get(fieldNum); return HCatRecordSerDe.serializeField( soi.getStructFieldData(wrappedObject, fref), fref.getFieldObjectInspector()); } catch (SerDeException e) { throw new IllegalStateException(...
206444_49
@Override public List<Object> getAll() { List<Object> r = new ArrayList<Object>(this.size()); for (int i = 0; i < this.size(); i++){ r.add(i, get(i)); } return r; }
206444_50
@Override public void set(int fieldNum, Object value) { throw new UnsupportedOperationException("not allowed to run set() on LazyHCatRecord"); }
206444_51
@Override public int size() { return soi.getAllStructFieldRefs().size(); }
206444_52
@Override public void readFields(DataInput in) throws IOException { throw new UnsupportedOperationException("LazyHCatRecord is intended to wrap" + " an object/object inspector as a HCatRecord " + "- it does not need to be read from DataInput."); }
206444_53
@Override public void write(DataOutput out) throws IOException { throw new UnsupportedOperationException("LazyHCatRecord is intended to wrap" + " an object/object inspector as a HCatRecord " + "- it does not need to be written to a DataOutput."); }
206444_54
@Override public void set(int fieldNum, Object value) { throw new UnsupportedOperationException("not allowed to run set() on LazyHCatRecord"); }
206444_55
@Override public void remove(int idx) throws HCatException { throw new UnsupportedOperationException("not allowed to run remove() on LazyHCatRecord"); }
206444_56
@Override public void copy(HCatRecord r) throws HCatException { throw new UnsupportedOperationException("not allowed to run copy() on LazyHCatRecord"); }
206444_57
public HCatRecord getWritable() throws HCatException { DefaultHCatRecord d = new DefaultHCatRecord(); d.copy(this); return d; }
206444_58
public static void setOutput(Job job, OutputJobInfo outputJobInfo) throws IOException { setOutput(job.getConfiguration(), job.getCredentials(), outputJobInfo); }
206444_59
public static void setOutput(Job job, OutputJobInfo outputJobInfo) throws IOException { setOutput(job.getConfiguration(), job.getCredentials(), outputJobInfo); }
206444_60
public static JobConfigurer createConfigurer(Job job) { return JobConfigurer.create(job); }
206444_61
public static JobConfigurer createConfigurer(Job job) { return JobConfigurer.create(job); }
206444_62
public static boolean validateMorePermissive(FsAction first, FsAction second) { if ((first == FsAction.ALL) || (second == FsAction.NONE) || (first == second)) { return true; } switch (first) { case READ_EXECUTE: return ((second == FsAction.READ) || (second == FsAction.EXECUTE)); case READ_WRITE: ...
206444_63
public static boolean validateExecuteBitPresentIfReadOrWrite(FsAction perms) { if ((perms == FsAction.READ) || (perms == FsAction.WRITE) || (perms == FsAction.READ_WRITE)) { return false; } return true; }