Tabnine Logo
IntWritable.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
org.apache.hadoop.io.IntWritable

Best Java code snippets using org.apache.hadoop.io.IntWritable.equals (Showing top 9 results out of 315)

origin: mahmoudparsian/data-algorithms-book

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  DateTemperaturePair that = (DateTemperaturePair) o;
  if (temperature != null ? !temperature.equals(that.temperature) : that.temperature != null) {
    return false;
  }
  if (yearMonth != null ? !yearMonth.equals(that.yearMonth) : that.yearMonth != null) {
    return false;
  }
  return true;
}
origin: pranab/chombo

public boolean equals(Object obj) {
  boolean isEqual =  false;
  if (obj instanceof IntPair) {
    IntPair iPair = (IntPair)obj;
    isEqual = first.equals(iPair.first) && second.equals(iPair.second);
  }
  
  return isEqual;
}

origin: mayconbordin/storm-applications

public boolean equals(Object obj) {
  boolean isEqual =  false;
  if (obj instanceof TextInt) {
    TextInt other = (TextInt)obj;
    isEqual = first.equals(other.first) && second.equals(other.second);
  }
  
  return isEqual;
}

origin: pranab/chombo

public boolean equals(Object obj) {
  boolean isEqual =  false;
  if (obj instanceof TextInt) {
    TextInt other = (TextInt)obj;
    isEqual = first.equals(other.first) && second.equals(other.second);
  }
  
  return isEqual;
}

origin: apache/incubator-rya

@Override
public boolean equals(Object o) {
 if (o instanceof CompositeType) {
  CompositeType comp = (CompositeType) o;
  return oldKey.equals(comp.oldKey) && priority.equals(comp.priority);
 }
 return false;
}
origin: org.apache.hadoop/hadoop-mapred-test

 public void reduce(BytesWritable key, Iterator<IntWritable> values,
           OutputCollector<BytesWritable, IntWritable> output,
           Reporter reporter) throws IOException {
  int ones = 0;
  int twos = 0;
  while (values.hasNext()) {
   IntWritable count = values.next(); 
   if (count.equals(sortInput)) {
    ++ones;
   } else if (count.equals(sortOutput)) {
    ++twos;
   } else {
    throw new IOException("Invalid 'value' of " + count.get() + 
               " for (key,value): " + key.toString());
   }
  }
  
  // Check to ensure there are equal no. of ones and twos
  if (ones != twos) {
   throw new IOException("Illegal ('one', 'two'): (" + ones + ", " + twos +
              ") for (key, value): " + key.toString());
  }
 }
}
origin: org.apache.hadoop/hadoop-mapred-test

private static int countProduct(IntWritable key, Path[] src, 
  Configuration conf) throws IOException {
 int product = 1;
 for (Path p : src) {
  int count = 0;
  SequenceFile.Reader r = new SequenceFile.Reader(
   cluster.getFileSystem(), p, conf);
  IntWritable k = new IntWritable();
  IntWritable v = new IntWritable();
  while (r.next(k, v)) {
   if (k.equals(key)) {
    count++;
   }
  }
  r.close();
  if (count != 0) {
   product *= count;
  }
 }
 return product;
}

origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

 public void reduce(BytesWritable key, Iterator<IntWritable> values,
           OutputCollector<BytesWritable, IntWritable> output,
           Reporter reporter) throws IOException {
  int ones = 0;
  int twos = 0;
  while (values.hasNext()) {
   IntWritable count = values.next(); 
   if (count.equals(sortInput)) {
    ++ones;
   } else if (count.equals(sortOutput)) {
    ++twos;
   } else {
    throw new IOException("Invalid 'value' of " + count.get() + 
               " for (key,value): " + key.toString());
   }
  }
  
  // Check to ensure there are equal no. of ones and twos
  if (ones != twos) {
   throw new IOException("Illegal ('one', 'two'): (" + ones + ", " + twos +
              ") for (key, value): " + key.toString());
  }
 }
}
origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

private static int countProduct(IntWritable key, Path[] src, 
  Configuration conf) throws IOException {
 int product = 1;
 for (Path p : src) {
  int count = 0;
  SequenceFile.Reader r = new SequenceFile.Reader(
   cluster.getFileSystem(), p, conf);
  IntWritable k = new IntWritable();
  IntWritable v = new IntWritable();
  while (r.next(k, v)) {
   if (k.equals(key)) {
    count++;
   }
  }
  r.close();
  if (count != 0) {
   product *= count;
  }
 }
 return product;
}

org.apache.hadoop.ioIntWritableequals

Javadoc

Returns true iff o is a IntWritable with the same value.

Popular methods of IntWritable

  • get
    Return the value of this IntWritable.
  • <init>
  • set
    Set the value of this IntWritable.
  • toString
  • write
  • readFields
  • compareTo
    Compares two IntWritables.
  • hashCode
  • getClass

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Permission (java.security)
    Legacy security code; do not use.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JList (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now