private synchronized long submitSnapshotProcedure(SnapshotDescription snapshot, long nonceGroup,
    long nonce) throws IOException {
    return MasterProcedureUtil
      .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(master, nonceGroup, nonce) {
        @Override
        protected void run() throws IOException {
          TableDescriptor tableDescriptor =
            master.getTableDescriptors().get(TableName.valueOf(snapshot.getTable()));
          MasterCoprocessorHost cpHost = getMaster().getMasterCoprocessorHost();
          User user = RpcServer.getRequestUser().orElse(null);
          org.apache.hadoop.hbase.client.SnapshotDescription snapshotDesc =
            ProtobufUtil.createSnapshotDesc(snapshot);

          if (cpHost != null) {
            cpHost.preSnapshot(snapshotDesc, tableDescriptor, user);
          }

          sanityCheckBeforeSnapshot(snapshot, false);

          long procId = submitProcedure(new SnapshotProcedure(
            getMaster().getMasterProcedureExecutor().getEnvironment(), snapshot));

          getMaster().getSnapshotManager().registerSnapshotProcedure(snapshot, procId);

          if (cpHost != null) {
            cpHost.postSnapshot(snapshotDesc, tableDescriptor, user);
          }
        }

        @Override
        protected String getDescription() {
          return "SnapshotProcedure";
        }
      });
  }
Take a snapshot based on the enabled/disabled state of the table.
@throws HBaseSnapshotException when a snapshot specific exception occurs.
@throws IOException            when some sort of generic IO exception occurs.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java