Tabnine Logo
Assert
Code IndexAdd Tabnine to your IDE (free)

How to use
Assert
in
com.gemstone.gemfire.internal

Best Java code snippets using com.gemstone.gemfire.internal.Assert (Showing top 20 results out of 315)

origin: io.snappydata/gemfire-core

 PrimaryInfo(boolean isHosting, boolean isPrimary, String hToken) {
  this.isHosting = isHosting; this.isPrimary = isPrimary;
  this.hostToken = hToken;
  if (this.isPrimary) {
   Assert.assertTrue(this.isHosting);
  }
 }
}
origin: io.snappydata/gemfire-core

/**
 * @see HashEntry#setMapValue(Object)
 */
public final void setMapValue(final Object newValue) {
 if (this != newValue) {
  Assert.fail("AbstractRegionEntry#setMapValue: unexpected setMapValue "
    + "with newValue=" + newValue + ", this=" + this);
 }
}
origin: io.snappydata/gemfire-core

public DLockGrantor getGrantor() {
 Assert.assertHoldsLock(this.destroyLock,false);
 synchronized (this.lockGrantorIdLock) {
  return this.grantor;
 }
}

origin: io.snappydata/gemfire-core

/**
 * Assert that a boolean value is true.
 * @param b the boolean value to check
 * @throws InternalGemFireError if false
 */
public static void assertTrue(boolean b) {
 if (!b) {
  throwError(null);
 }
}
origin: io.snappydata/gemfire-core

public static void assertTrue(boolean b, boolean message) {
 if (!b) {
  throwError(Boolean.valueOf(message));
 }
}

origin: io.snappydata/gemfire-core

@Override
protected void setMemoryThresholdFlag(MemoryEvent event) {
 Assert.assertTrue(false);
 //Bucket regions are not registered with ResourceListener,
 //and should not get this event
}
origin: org.apache.geode/gemfire-core

/**
 * @see HashEntry#setMapValue(Object)
 */
public final void setMapValue(final Object newValue) {
 if (this != newValue) {
  Assert.fail("AbstractRegionEntry#setMapValue: unexpected setMapValue "
    + "with newValue=" + newValue + ", this=" + this);
 }
}
origin: io.snappydata/gemfire-core

protected boolean isCurrentlyOrIsMakingLockGrantor() {
 Assert.assertHoldsLock(this.destroyLock,false);
 synchronized (this.lockGrantorIdLock) {
  return this.lockGrantorId != null && 
      this.lockGrantorId.isLocal(getSerialNumber());
 }
}
origin: io.snappydata/gemfire-core

public static void assertTrue(boolean b, char message) {
 if (!b) {
  throwError(Character.valueOf(message));
 }
}

origin: io.snappydata/gemfire-core

/** establishes the logwriter used by the conduit */
 public void setLogger(LogWriterI18n logger) {
  Assert.assertTrue(logger != null);
  this.logger = logger;
 }
 
origin: io.snappydata/snappydata-store-core

private ExtraTableInfo getExtraTableInfo(Properties properties,
  String schemaName) {
 // for temporary tables use null ExtraTableInfo and not base table's
 if (this.id.getSegmentId() == ContainerHandle.TEMPORARY_SEGMENT) {
  if (!GfxdConstants.SESSION_SCHEMA_NAME.equals(schemaName)) {
   Assert.fail("Expected schemaName for temporary table to be "
     + GfxdConstants.SESSION_SCHEMA_NAME + " but got " + schemaName);
  }
  return null;
 }
 return (ExtraTableInfo)properties.get(GfxdConstants.GFXD_DTDS);
}
origin: org.apache.geode/gemfire-core

boolean isCurrentlyOrIsMakingLockGrantor() {
 Assert.assertHoldsLock(this.destroyLock,false);
 synchronized (this.lockGrantorIdLock) {
  return this.lockGrantorId != null && 
      this.lockGrantorId.isLocal(getSerialNumber());
 }
}

origin: io.snappydata/gemfire-core

public static void assertTrue(boolean b, float message) {
 if (!b) {
  throwError(new Float(message));
 }
}

origin: io.snappydata/gemfirexd-core

private static Object checkName(Object name) {
 Assert.assertTrue(name != null,
   "Unexpected null name for GfxdReentrantReadWriteLock");
 return name;
}
origin: io.snappydata/gemfirexd

private ExtraTableInfo getExtraTableInfo(Properties properties,
  String schemaName) {
 // for temporary tables use null ExtraTableInfo and not base table's
 if (this.id.getSegmentId() == ContainerHandle.TEMPORARY_SEGMENT) {
  if (!GfxdConstants.SESSION_SCHEMA_NAME.equals(schemaName)) {
   Assert.fail("Expected schemaName for temporary table to be "
     + GfxdConstants.SESSION_SCHEMA_NAME + " but got " + schemaName);
  }
  return null;
 }
 return (ExtraTableInfo)properties.get(GfxdConstants.GFXD_DTDS);
}
origin: io.snappydata/gemfire-core

/** exchange profiles to initialize this advisor */
private void exchangeProfiles() {
 Assert.assertHoldsLock(this,false); // causes deadlock
 Assert.assertHoldsLock(this.initializeLock,true);
 DistributionAdvisee advisee = getAdvisee();
 new UpdateAttributesProcessor(advisee).distribute(true);
 setInitialized();
 if (advisee instanceof LocalRegion) {
  ((LocalRegion)advisee).setProfileExchanged(true);
 }
}
origin: org.apache.geode/gemfire-core

public static void assertTrue(boolean b, char message) {
 if (!b) {
  throwError(new Character(message));
 }
}

origin: org.apache.geode/gemfire-core

 PrimaryInfo(boolean isHosting, boolean isPrimary, String hToken) {
  this.isHosting = isHosting; this.isPrimary = isPrimary;
  this.hostToken = hToken;
  if (this.isPrimary) {
   Assert.assertTrue(this.isHosting);
  }
 }
}
origin: org.apache.geode/gemfire-core

@Override
public DiskEntry initializeRecoveredEntry(Object key, RecoveredEntry re) {
 if(re.getValue() == null) {
  Assert.fail("Value should not have been null for key " + key);
 }
 currentOplogEntries.put(key, re);
 return super.initializeRecoveredEntry(key, re);
}
origin: io.snappydata/gemfire-core

protected boolean isCurrentlyLockGrantor() {
 Assert.assertHoldsLock(this.destroyLock,false);
 synchronized (this.lockGrantorIdLock) {
  return this.lockGrantorId != null && 
      this.lockGrantorId.isLocal(getSerialNumber()) &&
      this.grantor != null &&
      this.grantor.isReady();
 }
}

com.gemstone.gemfire.internalAssert

Javadoc

Support for correctness assertions. "An assertion is a statement containing a boolean expression that the programmer believes to be true at the time the statement is executed. For example, after unmarshalling all of the arguments from a data buffer, a programmer might assert that the number of bytes of data remaining in the buffer is zero. The system executes the assertion by evaluating the boolean expression and reporting an error if it evaluates to false. By verifying that the boolean expression is indeed true, the system corroborates the programmer's knowledge of the program and increases his confidence that the program is free of bugs.Assertion checking may be disabled for increased performance. Typically, assertion-checking is enabled during program development and testing, and disabled during deployment." - from http://java.sun.com/aboutJava/communityprocess/jsr/asrt_prop.html This class does not provide a way to disable assertions for increased performance, since we cannot prevent the arguments from being evaluated in any case without changes to the Java language itself. The interface to this class was designed for easy migration to the new assert facility that is currently proposed for the Java language in JSR-000041

Most used methods

  • assertTrue
  • fail
  • assertHoldsLock
    This is a workaround for X bug 38288. JRockit can throw a NullPointerException from Thread.holdsLock
  • throwError

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • From CI to AI: The AI layer in your organization
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