setup-inputs a a
L0
  a.SET.1-b.SET.2
----
L0
  000001:[a#1,1-b#2,1]

setup-inputs c c
L0
  a.SET.1-b.SET.2
----

# Verify we expand the start level inputs to a clean cut.
setup-inputs a a
L1
  a.SET.1-b.SET.2
  b.SET.1-c.SET.2
----
L1
  000001:[a#1,1-b#2,1]
  000002:[b#1,1-c#2,1]

# The range deletion sentinel acts as a clean cut boundary.
setup-inputs a a
L1
  a.SET.1-b.RANGEDEL.72057594037927935
  b.SET.1-c.SET.2
----
L1
  000001:[a#1,1-b#72057594037927935,15]

# Verify we expand the output level inputs to a clean cut.
setup-inputs a a
L1
  a.SET.5-b.SET.6
L2
  a.SET.3-c.SET.4
  c.SET.3-d.SET.2
----
L1
  000001:[a#5,1-b#6,1]
L2
  000002:[a#3,1-c#4,1]
  000003:[c#3,1-d#2,1]

# Verify we expand the output level inputs to a clean cut.
setup-inputs a a
L1
  a.SET.5-b.SET.6
L2
  a.SET.3-c.RANGEDEL.72057594037927935
  c.SET.3-d.SET.2
----
L1
  000001:[a#5,1-b#6,1]
L2
  000002:[a#3,1-c#72057594037927935,15]

# Verify we grow the start level inputs to include all sstables which
# lie within the output level bounds.
setup-inputs a a
L1
  a.SET.5-b.SET.6
  c.SET.4-e.SET.3
L2
  a.SET.3-d.SET.4
----
L1
  000001:[a#5,1-b#6,1]
  000002:[c#4,1-e#3,1]
L2
  000003:[a#3,1-d#4,1]

# Verify we limit the start level input expansion according to available
# disk capacity.
setup-inputs avail-bytes=10 a a
L1
  a.SET.5-b.SET.6 size=2
  c.SET.4-e.SET.3 size=1
L2
  a.SET.3-d.SET.4 size=3
----
L1
  000001:[a#5,1-b#6,1]
L2
  000003:[a#3,1-d#4,1]

# Verify the available disk capacity limit doesn't affect the
# output level clean-cut expansion.
setup-inputs avail-bytes=10 a a
L1
  a.SET.5-b.SET.6 size=5
  c.SET.4-e.SET.3 size=10
L2
  a.SET.3-d.SET.4 size=5
  d.SET.2-e.SET.2 size=5
----
L1
  000001:[a#5,1-b#6,1]
L2
  000003:[a#3,1-d#4,1]
  000004:[d#2,1-e#2,1]

# We won't grow the start level inputs if doing so would grow the
# output level inputs.
setup-inputs a a
L1
  a.SET.5-b.SET.6
  c.SET.4-e.SET.3
L2
  a.SET.3-d.SET.4
  e.SET.2-f.SET.1
----
L1
  000001:[a#5,1-b#6,1]
L2
  000003:[a#3,1-d#4,1]

# Verify setup inputs can identify compacting files in range
setup-inputs a a
L1
  a.SET.5-b.SET.6
L2
  a.SET.3-c.SET.4
  c.SET.3-d.SET.2 compacting
  d.SET.3-e.SET.6
----
L1
  000001:[a#5,1-b#6,1]
L2
  000002:[a#3,1-c#4,1]
  000003:[c#3,1-d#2,1]
  000004:[d#3,1-e#6,1]
is-compacting

# Verify when there is one file in range and it is compacting
setup-inputs a a
L2
  a.SET.3-c.SET.4 compacting
  d.SET.3-e.SET.2
----
L2
  000001:[a#3,1-c#4,1]
is-compacting

# Verify when there is one file in level and is compacting
setup-inputs a a
L2
  a.SET.3-c.SET.4 compacting
----
L2
  000001:[a#3,1-c#4,1]
is-compacting