Get the expected high {@link Watermark}. A default {@link Gson} object will be used to deserialize the watermark.

@param watermarkClass the watermark class for this {@code WorkUnit}.
@return the expected high watermark in this {@code WorkUnit}.
428569
public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass) {
    return getExpectedHighWatermark(watermarkClass, GSON);
  }
1023867
def watermark(self, image, options):
        
        watermark_img = options.get("watermark", settings.THUMBNAIL_WATERMARK)
        if not watermark_img:
            raise AttributeError("No THUMBNAIL_WATERMARK defined or set on tag.")
        watermark_path = find(watermark_img)
        if not watermark_path:
            raise RuntimeError("Could not find the configured watermark file.")
        if not os.path.isfile(watermark_path):
            raise RuntimeError("Set watermark does not point to a file.")

        if "cropbox" not in options:
            options["cropbox"] = None
        if "watermark_alpha" not in options:
            options["watermark_alpha"] = settings.THUMBNAIL_WATERMARK_OPACITY

        mark_sizes = options.get("watermark_size", settings.THUMBNAIL_WATERMARK_SIZE)
        if mark_sizes:
            try:
                options["watermark_size"] = parse_geometry(
                    mark_sizes, self.get_image_ratio(image, options)
                )
            except TypeError as e:
                raise TypeError(
                    "Please, update sorl-thumbnail package version to  >= 11.12b. %s"
                    % e
                )
        else:
            options["watermark_size"] = False

        if "watermark_pos" not in options:
            options["watermark_pos"] = settings.THUMBNAIL_WATERMARK_POSITION

        return self._watermark(
            image,
            watermark_path,
            options["watermark_alpha"],
            options["watermark_size"],
            options["watermark_pos"],
        )
19892
public PropertyNameProcessor findJavaPropertyNameProcessor( Class beanClass ) {
      if( !javaPropertyNameProcessorMap.isEmpty() ) {
         Object key = javaPropertyNameProcessorMatcher.getMatch( beanClass, javaPropertyNameProcessorMap.keySet() );
         return (PropertyNameProcessor) javaPropertyNameProcessorMap.get( key );

      }
      return null;
   }
613152
private JavaClass getSuperclass(JavaClass javaClass) {
    try {
      return javaClass.getSuperClass();
    } catch (ClassNotFoundException e) {
      bugReporter.reportMissingClass(e);
      return null;
    }
  }
572369
protected final String getForPrint(final Class<?> pClass) {
    if (pClass == SubaccountLine.class || pClass == Account.class
          || pClass == AdditionCostLine.class) {
      return PrcAccEntityWithSubaccRetrieve.class.getSimpleName();
    } else if (pClass == MoveItems.class) {
      return PrcMoveItemsRetrieve.class.getSimpleName();
    } else if (pClass == AccountingEntries.class) {
      return PrcInpAccEntriesRetrieve.class.getSimpleName();
    } else if (pClass == PaymentFrom.class || pClass == PaymentTo.class
        || pClass == PrepaymentFrom.class || pClass == PrepaymentTo.class) {
      return PrcAccDocWithSubaccRetrieve.class.getSimpleName();
    } else if (pClass == Wage.class) {
      return PrcAccDocRetrieve.class.getSimpleName();
    } else if (pClass == PurchaseReturn.class
      || pClass == ManufacturingProcess.class || pClass == Manufacture.class) {
      return PrcAccDocUseMaterialRetrieve.class.getSimpleName();
    } else if (pClass == GoodsLoss.class || pClass == SalesInvoice.class) {
      return PrcAccDocCogsRetrieve.class.getSimpleName();
    } else if (pClass == PurchaseInvoice.class || pClass == SalesReturn.class
      || pClass == BeginningInventory.class) {
      return PrcAccDocFullRetrieve.class.getSimpleName();
    } else {
      if (this.hldAddEntitiesProcessorNames != null) {
        String name = this.hldAddEntitiesProcessorNames
          .getForPrint(pClass);
        if (name != null) {
          return name;
        }
      }
      return PrcEntityRetrieve.class.getSimpleName();
    }
  }
135860
public JsonElement getActualHighWatermark() {
    if (!contains(ConfigurationKeys.WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY)) {
      return null;
    }
    return JSON_PARSER.parse(getProp(ConfigurationKeys.WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY));
  }
1331944
@Override
    public long getCountLowWaterMark() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getCountLowWaterMark");

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getCountLowWaterMark", new Long(_nextLowWatermark));
        return _nextLowWatermark;
    }
30596
protected static Class getWrapperClass(Class c) {
        if (c == Integer.TYPE) {
            c = Integer.class;
        } else if (c == Byte.TYPE) {
            c = Byte.class;
        } else if (c == Long.TYPE) {
            c = Long.class;
        } else if (c == Double.TYPE) {
            c = Double.class;
        } else if (c == Float.TYPE) {
            c = Float.class;
        } else if (c == Boolean.TYPE) {
            c = Boolean.class;
        } else if (c == Character.TYPE) {
            c = Character.class;
        } else if (c == Short.TYPE) {
            c = Short.class;
        }
        return c;
    }
831220
public static String getJar(Class<?> klass) {
    Preconditions.checkNotNull(klass, "klass");
    ClassLoader loader = klass.getClassLoader();
    if (loader != null) {
      String class_file = klass.getName().replaceAll("\\.", "/") + ".class";
      try {
        for (Enumeration<?> itr = loader.getResources(class_file); itr.hasMoreElements();) {
          URL url = (URL) itr.nextElement();
          String path = url.getPath();
          if (path.startsWith("file:")) {
            path = path.substring("file:".length());
          }
          path = URLDecoder.decode(path, "UTF-8");
          if ("jar".equals(url.getProtocol())) {
            path = URLDecoder.decode(path, "UTF-8");
            return path.replaceAll("!.*$", "");
          } else if ("file".equals(url.getProtocol())) {
            String klassName = klass.getName();
            klassName = klassName.replace(".", "/") + ".class";
            path = path.substring(0, path.length() - klassName.length());
            File baseDir = new File(path);
            File testDir = new File(System.getProperty("test.build.dir", "target/test-dir"));
            testDir = testDir.getAbsoluteFile();
            if (!testDir.exists()) {
              if (!testDir.mkdirs()) {
                throw new IOException("Unable to create directory :"+testDir.toString());
              }
            }
            File tempJar = File.createTempFile(TMP_HADOOP, "", testDir);
            tempJar = new File(tempJar.getAbsolutePath() + ".jar");
            createJar(baseDir, tempJar);
            return tempJar.getAbsolutePath();
          }
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    return null;
  }
3527
protected String createPlainTextJWT() {
        com.google.gson.JsonObject header = createHeader();
        com.google.gson.JsonObject payload = createPayload();

        String plainTextTokenString = computeBaseString(header, payload);
        StringBuffer sb = new StringBuffer(plainTextTokenString);
        sb.append(".").append("");
        return sb.toString();
    }
1284260
@Override
    public long getByteHighWaterMark() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(tc, "getByteHighWaterMark");
            SibTr.exit(tc, "getByteHighWaterMark");
        }
        return -1;
    }
183571
public static Optional<WatermarkInterval> getCopyableFileWatermark(CopyableFile copyableFile,
      Optional<CopyableFileWatermarkGenerator> watermarkGenerator)
      throws IOException {
    if (!watermarkGenerator.isPresent()) {
      return Optional.absent();
    }
    return watermarkGenerator.get().generateWatermarkIntervalForCopyableFile(copyableFile);
  }
693318
public Extractor<S, D> build() throws ExtractPrepareException {
    String watermarkColumn = this.workUnitState.getProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY);
    long lwm = partition.getLowWatermark();
    long hwm = partition.getHighWatermark();
    log.info("Low water mark: " + lwm + "; and High water mark: " + hwm);

    WatermarkType watermarkType;
    if (StringUtils.isBlank(this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_WATERMARK_TYPE))) {
      watermarkType = null;
    } else {
      watermarkType = WatermarkType
          .valueOf(this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_WATERMARK_TYPE).toUpperCase());
    }

    log.info("Source Entity is " + this.entity);
    try {
      this.setTimeOut(
          this.workUnitState.getPropAsInt(ConfigurationKeys.SOURCE_CONN_TIMEOUT, ConfigurationKeys.DEFAULT_CONN_TIMEOUT));
      this.extractMetadata(this.schema, this.entity, this.workUnit);

      if (StringUtils.isNotBlank(watermarkColumn)) {
        if (partition.isLastPartition()) {
          // Get a more accurate high watermark from the source
          long adjustedHighWatermark = this.getLatestWatermark(watermarkColumn, watermarkType, lwm, hwm);
          log.info("High water mark from source: " + adjustedHighWatermark);
          // If the source reports a finer high watermark, then consider the same as runtime high watermark.
          // Else, consider the low watermark as high water mark(with no delta).i.e, don't move the pointer
          if (adjustedHighWatermark == ConfigurationKeys.DEFAULT_WATERMARK_VALUE) {
            adjustedHighWatermark = getLowWatermarkWithNoDelta(lwm);
          }
          this.highWatermark = adjustedHighWatermark;
        } else {
          this.highWatermark = hwm;
        }

        log.info("High water mark for the current run: " + highWatermark);
        this.setRangePredicates(watermarkColumn, watermarkType, lwm, highWatermark);
      }

      // if it is set to true, skip count calculation and set source count to -1
      if (!Boolean.valueOf(this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_SKIP_COUNT_CALC))) {
        this.sourceRecordCount = this.getSourceCount(this.schema, this.entity, this.workUnit, this.predicateList);
      } else {
        log.info("Skip count calculation");
        this.sourceRecordCount = -1;
      }

      if (this.sourceRecordCount == 0) {
        log.info("Record count is 0; Setting fetch status to false to skip readRecord()");
        this.setFetchStatus(false);
      }
    } catch (SchemaException e) {
      throw new ExtractPrepareException("Failed to get schema for this object; error - " + e.getMessage(), e);
    } catch (HighWatermarkException e) {
      throw new ExtractPrepareException("Failed to get high watermark; error - " + e.getMessage(), e);
    } catch (RecordCountException e) {
      throw new ExtractPrepareException("Failed to get record count; error - " + e.getMessage(), e);
    } catch (Exception e) {
      throw new ExtractPrepareException("Failed to prepare the extract build; error - " + e.getMessage(), e);
    }
    return this;
  }
1091106
public static ClassDescriptor getClassDescriptor(JavaClass jclass) {
        return DescriptorFactory.instance().getClassDescriptor(ClassName.toSlashedClassName(jclass.getClassName()));
    }
1110195
@Override
    public long getCountHighWaterMark() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getCountHighWaterMark");

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getCountHighWaterMark", new Long(_nextHighWatermark));
        return _nextHighWatermark;
    }
132165
public static <T> T getEntity(InputStream in, Class<T> clazz) {
        if (clazz == InputStream.class) {
            //noinspection unchecked
            return (T) clazz;
        }

        try {
            return JsonHelper.readJson(in, clazz);
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }
1126968
public Class getNewClass() throws IllegalStateException, ClassFormatError {
        if (mClass != null) {
            return mClass;
        }
        ByteArrayOutputStream data = mData;
        if (data == null) {
            throw new IllegalStateException("Class not defined yet");
        }

        byte[] bytes = data.toByteArray();

        if (DEBUG) {
            File file = new File(mName.replace('.', '/') + ".class");
            try {
                File tempDir = new File(System.getProperty("java.io.tmpdir"));
                file = new File(tempDir, file.getPath());
            } catch (SecurityException e) {
            }
            try {
                file.getParentFile().mkdirs();
                System.out.println("ClassInjector writing to " + file);
                OutputStream out = new FileOutputStream(file);
                out.write(bytes);
                out.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        mClass = mLoader.define(mName, bytes);
        mData = null;
        return mClass;
    }